Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.unitils.jodatime.annotation;
 
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
Sets the DateTime to an offset relative to the current system time. Basicly the DateTime in millis will be System.currentTimeMillis() + offset. The offset is calculated as a Period in years, months, days, hours, minutes, seconds, weeks and millis. Which means the user doesn't have to calculate the offset for a given year, but can just set the years value to -1 to go back one year in time.

Author(s):
Christophe De Blende
Jeroen Horemans
Thomas De Rycke
Willemijn Wouters
Since:
1.0.0
})
public @interface OffsetDateTime {

    

Returns:
offset in years.
    int years() default 0;

    

Returns:
offset in months.
    int months() default 0;

    

Returns:
offset in days.
    int days() default 0;

    

Returns:
offset in hours.
    int hours() default 0;

    

Returns:
offset in minutes.
    int minutes() default 0;

    

Returns:
offset in seconds.
    int seconds() default 0;

    

Returns:
offset in weeks.
    int weeks() default 0;

    

Returns:
offset in millis.
    int millis() default 0;
New to GrepCode? Check out our FAQ X