-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update event_time (SimpleEvent_V1.scala), add date utils
- Loading branch information
yennan.liu
committed
Apr 27, 2021
1 parent
b9188f9
commit 99e4de0
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.yen.utils | ||
|
||
import org.joda.time.{DateTime, DateTimeZone} | ||
import org.joda.time.format.{DateTimeFormat, DateTimeFormatter, ISODateTimeFormat} | ||
|
||
object DateUtils { | ||
// datetime format | ||
val yyyyMMFormat: DateTimeFormatter = DateTimeFormat.forPattern("yyyyMM") | ||
val yyyyMMddFormat: DateTimeFormatter = DateTimeFormat.forPattern("yyyyMMdd") | ||
val yyyyMMddHHFormat: DateTimeFormatter = DateTimeFormat.forPattern("yyyyMMddHH") | ||
|
||
// time zone | ||
val dateFormatTaipei: DateTimeFormatter = DateTimeFormat.forPattern("yyyyMMdd").withZone(DateTimeZone.forID("Asia/Taipei")) | ||
|
||
// iso time | ||
val ISO8601Format: DateTimeFormatter = ISODateTimeFormat.dateTime() | ||
} | ||
|