Skip to content

Latest commit

 

History

History

vrml-time

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Build Status

vrml-time

A time API with timezone/cron for vrml library

Usage

Maven

<dependency>
  <groupId>group.rxcloud</groupId>
  <artifactId>vrml-time</artifactId>
  <version>1.1.4</version>
</dependency>

Time util

The ThreadLocal time utils. Avoid the overhead of creating DateFormat repeatedly. Focus on the three types of Date/Time/DateTime. Operation orientation to the Date/Timestamp/String.

  // use static func
  ThreadLocalTimeUtils.func(params);

TimeZone util

TimeZone time conversion.

TimeZone -12 ~ +12 based on UTC.

  // TimeZone conversion
  TimeZoneUtils.parseTimezoneTimestamp(sourceTimezone, targetTimezone, sourceTimestamp);

Cron util

Parse the cron expression.

Three parsing approaches are supported : DAY/WEEK/MONTH.

Support for parsing timezone transitions.

  // cron expression resolution for timezone conversion
  CronExpressionUtils.parseCronToTargetTimeZone(TimeZoneCronParseBuilder builder);
  
  // cron expression resolution
  CronExpressionUtils.parseCron(SimpleCronParseBuilder builder);

Example

Unit test

Check it out below:

import CronExpressionUtilsTest;
import TimeZoneUtilsTest;
import ThreadLocalTimeUtilsTest;

Become a Developer

Developer repository can be found here.

Maven

<dependency>
  <groupId>group.rxcloud</groupId>
  <artifactId>vrml-time</artifactId>
  <version>1.1.4</version>
</dependency>

Contributing

A small number of users have reported problems building vrml. Read our contribution guide for details.