mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
import transaction from GnuCash database
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
const (
|
||||
longDateTimeFormat = "2006-01-02 15:04:05"
|
||||
longDateTimeWithTimezoneFormat = "2006-01-02 15:04:05Z07:00"
|
||||
longDateTimeWithTimezoneFormat2 = "2006-01-02 15:04:05 Z0700"
|
||||
longDateTimeWithoutSecondFormat = "2006-01-02 15:04"
|
||||
shortDateTimeFormat = "2006-1-2 15:4:5"
|
||||
yearMonthDateTimeFormat = "2006-01"
|
||||
@@ -141,6 +142,11 @@ func ParseFromLongDateTimeWithTimezone(t string) (time.Time, error) {
|
||||
return time.Parse(longDateTimeWithTimezoneFormat, t)
|
||||
}
|
||||
|
||||
// ParseFromLongDateTimeWithTimezone2 parses a formatted string in long date time format
|
||||
func ParseFromLongDateTimeWithTimezone2(t string) (time.Time, error) {
|
||||
return time.Parse(longDateTimeWithTimezoneFormat2, 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