import transaction from firefly iii
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
const (
|
||||
longDateTimeFormat = "2006-01-02 15:04:05"
|
||||
longDateTimeWithTimezoneFormat = "2006-01-02T15:04:05Z07:00"
|
||||
longDateTimeWithoutSecondFormat = "2006-01-02 15:04"
|
||||
shortDateTimeFormat = "2006-1-2 15:4:5"
|
||||
yearMonthDateTimeFormat = "2006-01"
|
||||
@@ -135,6 +136,11 @@ func ParseFromLongDateTime(t string, utcOffset int16) (time.Time, error) {
|
||||
return time.ParseInLocation(longDateTimeFormat, t, timezone)
|
||||
}
|
||||
|
||||
// ParseFromLongDateTimeWithTimezone parses a formatted string in long date time format
|
||||
func ParseFromLongDateTimeWithTimezone(t string) (time.Time, error) {
|
||||
return time.Parse(longDateTimeWithTimezoneFormat, t)
|
||||
}
|
||||
|
||||
// ParseFromLongDateTimeWithoutSecond parses a formatted string in long date time format (no second)
|
||||
func ParseFromLongDateTimeWithoutSecond(t string, utcOffset int16) (time.Time, error) {
|
||||
timezone := time.FixedZone("Timezone", int(utcOffset)*60)
|
||||
|
||||
Reference in New Issue
Block a user