Documentation ¶
Index ¶
- Constants
- func FormatTokenIsNotMapped(formatToken string) error
- func LoadLocation(timezone string) (*time.Location, error)
- type DateTime
- func DateTimeFromTime(time time.Time) DateTime
- func FromUnixTimestamp(timestamp int64) DateTime
- func NewDateTime(year int, month int, day int, hour int, minute int, second int, nanosecond int, ...) DateTime
- func NewLocalDateTime(year int, month int, day int, hour int, minute int, second int, nanosecond int) DateTime
- func NewUTCDateTime(year int, month int, day int, hour int, minute int, second int, nanosecond int) DateTime
- func Now() DateTime
- func NowInTimezone(timezone Timezone) DateTime
- func Parse(value string, format string) (DateTime, error)
- func ParseInTimezone(value string, format string, timezone Timezone) (DateTime, error)
- func UTCNow() DateTime
- func (dt DateTime) CTimeFormat() string
- func (dt DateTime) CeilDay() DateTime
- func (dt DateTime) CeilHour() DateTime
- func (dt DateTime) CeilMinute() DateTime
- func (dt DateTime) CeilMonth() DateTime
- func (dt DateTime) CeilSecond() DateTime
- func (dt DateTime) CeilWeek() DateTime
- func (dt DateTime) CeilYear() DateTime
- func (dt DateTime) Copy() DateTime
- func (dt DateTime) Day() int
- func (dt DateTime) FloorDay() DateTime
- func (dt DateTime) FloorHour() DateTime
- func (dt DateTime) FloorMinute() DateTime
- func (dt DateTime) FloorMonth() DateTime
- func (dt DateTime) FloorSecond() DateTime
- func (dt DateTime) FloorWeek() DateTime
- func (dt DateTime) FloorYear() DateTime
- func (dt DateTime) Format(format string) string
- func (dt DateTime) GoString() string
- func (dt DateTime) Hour() int
- func (dt DateTime) InTimezone(timezone Timezone) DateTime
- func (dt DateTime) IsBetween(start DateTime, end DateTime) bool
- func (dt DateTime) IsoCalendar() (int, int, int)
- func (dt DateTime) IsoFormat() string
- func (dt DateTime) IsoFormatTZ() string
- func (dt DateTime) Minute() int
- func (dt DateTime) Month() int
- func (dt DateTime) Nanosecond() int
- func (dt DateTime) Replace(year int, month int, day int, hour int, minute int, second int, nanosecond int) DateTime
- func (dt DateTime) ReplaceDay(day int) DateTime
- func (dt DateTime) ReplaceHour(hour int) DateTime
- func (dt DateTime) ReplaceMinute(minute int) DateTime
- func (dt DateTime) ReplaceMonth(month int) DateTime
- func (dt DateTime) ReplaceNanosecond(nanosecond int) DateTime
- func (dt DateTime) ReplaceSecond(second int) DateTime
- func (dt DateTime) ReplaceYear(year int) DateTime
- func (dt DateTime) Second() int
- func (dt DateTime) Shift(years int, months int, days int, hours int, minutes int, seconds int, ...) DateTime
- func (dt DateTime) ShiftDays(days int) DateTime
- func (dt DateTime) ShiftHours(hours int) DateTime
- func (dt DateTime) ShiftMicroSeconds(microsecond int) DateTime
- func (dt DateTime) ShiftMilliSeconds(millisecond int) DateTime
- func (dt DateTime) ShiftMinutes(minutes int) DateTime
- func (dt DateTime) ShiftMonths(months int) DateTime
- func (dt DateTime) ShiftNanoseconds(nanosecond int) DateTime
- func (dt DateTime) ShiftSeconds(second int) DateTime
- func (dt DateTime) ShiftWeeks(weeks int) DateTime
- func (dt DateTime) ShiftYears(years int) DateTime
- func (dt DateTime) SpanDay() (DateTime, DateTime)
- func (dt DateTime) SpanHour() (DateTime, DateTime)
- func (dt DateTime) SpanMinute() (DateTime, DateTime)
- func (dt DateTime) SpanMonth() (DateTime, DateTime)
- func (dt DateTime) SpanSecond() (DateTime, DateTime)
- func (dt DateTime) SpanWeek() (DateTime, DateTime)
- func (dt DateTime) SpanYear() (DateTime, DateTime)
- func (dt DateTime) String() string
- func (dt DateTime) Time() time.Time
- func (dt DateTime) Timezone() Timezone
- func (dt DateTime) UnixTimestamp() int64
- func (dt DateTime) WeekDay() time.Weekday
- func (dt DateTime) Year() int
- type FormatToken
- type Timezone
Constants ¶
const ( // Iso8601 format // // Example: 2012-12-12T12:12:12.000000 // Iso8601 = "YYYY-MM-DDTHH:mm:ss.S" // Iso8601TZ format with timezone // // Example with UTC: 2012-12-12T12:12:12.000000Z // Example with timezone: 2012-12-12T12:12:12.000000+0200 // Iso8601TZ = "YYYY-MM-DDTHH:mm:ss.SZ" // CTime format with ctime standard // // Example: Sat Jan 19 18:26:50 2019 // CTime = "ddd MMM DD HH:mm:ss YYYY" )
const ( YearFull = FormatToken("YYYY") YearShort = FormatToken("YY") MonthFull = FormatToken("MMMM") MonthAbbr = FormatToken("MMM") MonthZeroPadded = FormatToken("MM") MonthShort = FormatToken("M") DayOfYearZeroPadded = FormatToken("DDDD") DayOfMonthZeroPadded = FormatToken("DD") DayOfMonthShort = FormatToken("D") DayOfMonthOrdinal = FormatToken("Do") DayOfWeekFullName = FormatToken("dddd") DayOfWeekAbbr = FormatToken("ddd") TwentyFourHourZeroPadded = FormatToken("HH") TwelveHourZeroPadded = FormatToken("hh") TwelveHour = FormatToken("h") AMPMUpper = FormatToken("A") AMPMLower = FormatToken("a") MinuteZeroPadded = FormatToken("mm") Minute = FormatToken("m") SecondZeroPadded = FormatToken("ss") Second = FormatToken("s") MicroSecond = FormatToken("S") TimezoneFullName = FormatToken("ZZZ") TimezoneWithColon = FormatToken("zz") TimezoneWithoutColon = FormatToken("Z") GoLongMonth = goFormatToken("January") GoMonth = goFormatToken("Jan") GoNumMonth = goFormatToken("1") GoZeroMonth = goFormatToken("01") GoLongWeekDay = goFormatToken("Monday") GoWeekDay = goFormatToken("Mon") GoDay = goFormatToken("2") GoDayOrdinal = goFormatToken("Do") GoZeroDay = goFormatToken("02") GoZeroYearDay = goFormatToken("002") GoHour = goFormatToken("15") GoHour12 = goFormatToken("3") GoZeroHour12 = goFormatToken("03") GoMinute = goFormatToken("4") GoZeroMinute = goFormatToken("04") GoSecond = goFormatToken("5") GoZeroSecond = goFormatToken("05") GoLongYear = goFormatToken("2006") GoYear = goFormatToken("06") GoPM = goFormatToken("PM") Gopm = goFormatToken("pm") GoTZ = goFormatToken("MST") GoMillisecond = goFormatToken("000") GoMicrosecond = goFormatToken("000000") GoNanoSecond = goFormatToken("000000000") GoISO8601TZ = goFormatToken("Z0700") // prints Z for UTC GoISO8601SecondsTZ = goFormatToken("Z070000") GoISO8601ShortTZ = goFormatToken("Z07") GoISO8601ColonTZ = goFormatToken("Z07:00") // prints Z for UTC GoISO8601ColonSecondsTZ = goFormatToken("Z07:00:00") GoNumTZ = goFormatToken("-0700") // always numeric GoNumSecondsTz = goFormatToken("-070000") GoNumShortTZ = goFormatToken("-07") // always numeric GoNumColonTZ = goFormatToken("-07:00") // always numeric GoNumColonSecondsTZ = goFormatToken("-07:00:00") )
All FormatTokens for parsing and formatting with DateTime
const ( AfricaAbidjan = Timezone("Africa/Abidjan") AfricaAccra = Timezone("Africa/Accra") AfricaAddisAbaba = Timezone("Africa/AddisAbaba") AfricaAlgiers = Timezone("Africa/Algiers") AfricaAsmara = Timezone("Africa/Asmara") AfricaBamako = Timezone("Africa/Bamako") AfricaBangui = Timezone("Africa/Bangui") AfricaBanjul = Timezone("Africa/Banjul") AfricaBissau = Timezone("Africa/Bissau") AfricaBlantyre = Timezone("Africa/Blantyre") AfricaBrazzaville = Timezone("Africa/Brazzaville") AfricaBujumbura = Timezone("Africa/Bujumbura") AfricaCairo = Timezone("Africa/Cairo") AfricaCasablanca = Timezone("Africa/Casablanca") AfricaCeuta = Timezone("Africa/Ceuta") AfricaConakry = Timezone("Africa/Conakry") AfricaDakar = Timezone("Africa/Dakar") AfricaDaresSalaam = Timezone("Africa/DaresSalaam") AfricaDjibouti = Timezone("Africa/Djibouti") AfricaDouala = Timezone("Africa/Douala") AfricaElAaiun = Timezone("Africa/ElAaiun") AfricaFreetown = Timezone("Africa/Freetown") AfricaGaborone = Timezone("Africa/Gaborone") AfricaHarare = Timezone("Africa/Harare") AfricaJohannesburg = Timezone("Africa/Johannesburg") AfricaJuba = Timezone("Africa/Juba") AfricaKampala = Timezone("Africa/Kampala") AfricaKhartoum = Timezone("Africa/Khartoum") AfricaKigali = Timezone("Africa/Kigali") AfricaKinshasa = Timezone("Africa/Kinshasa") AfricaLagos = Timezone("Africa/Lagos") AfricaLibreville = Timezone("Africa/Libreville") AfricaLome = Timezone("Africa/Lome") AfricaLuanda = Timezone("Africa/Luanda") AfricaLubumbashi = Timezone("Africa/Lubumbashi") AfricaLusaka = Timezone("Africa/Lusaka") AfricaMalabo = Timezone("Africa/Malabo") AfricaMaputo = Timezone("Africa/Maputo") AfricaMaseru = Timezone("Africa/Maseru") AfricaMbabane = Timezone("Africa/Mbabane") AfricaMogadishu = Timezone("Africa/Mogadishu") AfricaMonrovia = Timezone("Africa/Monrovia") AfricaNairobi = Timezone("Africa/Nairobi") AfricaNdjamena = Timezone("Africa/Ndjamena") AfricaNiamey = Timezone("Africa/Niamey") AfricaNouakchott = Timezone("Africa/Nouakchott") AfricaOuagadougou = Timezone("Africa/Ouagadougou") AfricaPortoNovo = Timezone("Africa/Porto-Novo") AfricaSaoTome = Timezone("Africa/SaoTome") AfricaTripoli = Timezone("Africa/Tripoli") AfricaTunis = Timezone("Africa/Tunis") AfricaWindhoek = Timezone("Africa/Windhoek") AmericaAdak = Timezone("America/Adak") AmericaAnchorage = Timezone("America/Anchorage") AmericaAnguilla = Timezone("America/Anguilla") AmericaAntigua = Timezone("America/Antigua") AmericaAraguaina = Timezone("America/Araguaina") AmericaArgentinaBuenosAires = Timezone("America/Argentina/BuenosAires") AmericaArgentinaCatamarca = Timezone("America/Argentina/Catamarca") AmericaArgentinaComodRivadavia = Timezone("America/Argentina/ComodRivadavia") AmericaArgentinaCordoba = Timezone("America/Argentina/Cordoba") AmericaArgentinaJujuy = Timezone("America/Argentina/Jujuy Jujuy") AmericaArgentinaLaRioja = Timezone("America/Argentina/LaRioja") AmericaArgentinaMendoza = Timezone("America/Argentina/Mendoza") AmericaArgentinaRioGallegos = Timezone("America/Argentina/RioGallegos") AmericaArgentinaSalta = Timezone("America/Argentina/Salta Salta") AmericaArgentinaSanJuan = Timezone("America/Argentina/SanJuan") AmericaArgentinaSanLuis = Timezone("America/Argentina/SanLuis") AmericaArgentinaTucuman = Timezone("America/Argentina/Tucuman") AmericaArgentinaUshuaia = Timezone("America/Argentina/Ushuaia") AmericaAruba = Timezone("America/Aruba") AmericaAsuncion = Timezone("America/Asuncion") AmericaAtikokan = Timezone("America/Atikokan") AmericaAtka = Timezone("America/Atka") AmericaBahia = Timezone("America/Bahia") AmericaBahiaBanderas = Timezone("America/BahiaBanderas") AmericaBarbados = Timezone("America/Barbados") AmericaBelem = Timezone("America/Belem") AmericaBelize = Timezone("America/Belize") AmericaBlanc = Timezone("America/Blanc") AmericaBoaVista = Timezone("America/BoaVista") AmericaBogota = Timezone("America/Bogota") AmericaBoise = Timezone("America/Boise") AmericaBuenosAires = Timezone("America/BuenosAires") AmericaCambridgeBay = Timezone("America/CambridgeBay") AmericaCampoGrande = Timezone("America/CampoGrande") AmericaCancun = Timezone("America/Cancun") AmericaCaracas = Timezone("America/Caracas") AmericaCatamarca = Timezone("America/Catamarca") AmericaCayenne = Timezone("America/Cayenne") AmericaCayman = Timezone("America/Cayman") AmericaChicago = Timezone("America/Chicago") AmericaChihuahua = Timezone("America/Chihuahua") AmericaCoralHarbour = Timezone("America/CoralHarbour") AmericaCordoba = Timezone("America/Cordoba") AmericaCostaRica = Timezone("America/CostaRica") AmericaCreston = Timezone("America/Creston") AmericaCuiaba = Timezone("America/Cuiaba") AmericaCuracao = Timezone("America/Curacao") AmericaDanmarkshavn = Timezone("America/Danmarkshavn") AmericaDawson = Timezone("America/Dawson") AmericaDawsonCreek = Timezone("America/DawsonCreek") AmericaDenver = Timezone("America/Denver") AmericaDetroit = Timezone("America/Detroit") AmericaDominica = Timezone("America/Dominica") AmericaEdmonton = Timezone("America/Edmonton") AmericaEirunepe = Timezone("America/Eirunepe") AmericaElSalvador = Timezone("America/ElSalvador") AmericaEnsenada = Timezone("America/Ensenada") AmericaFortNelson = Timezone("America/FortNelson") AmericaFortWayne = Timezone("America/FortWayne") AmericaFortaleza = Timezone("America/Fortaleza") AmericaGlaceBay = Timezone("America/GlaceBay") AmericaGodthab = Timezone("America/Godthab") AmericaGooseBay = Timezone("America/GooseBay") AmericaGrandTurk = Timezone("America/GrandTurk") AmericaGrenada = Timezone("America/Grenada") AmericaGuadeloupe = Timezone("America/Guadeloupe") AmericaGuatemala = Timezone("America/Guatemala") AmericaGuayaquil = Timezone("America/Guayaquil") AmericaGuyana = Timezone("America/Guyana") AmericaHalifax = Timezone("America/Halifax") AmericaHavana = Timezone("America/Havana") AmericaHermosillo = Timezone("America/Hermosillo") AmericaIndianaIndianapolis = Timezone("America/Indiana/Indianapolis") AmericaIndianaKnox = Timezone("America/Indiana/Knox") AmericaIndianaMarengo = Timezone("America/Indiana/Marengo") AmericaIndianaPetersburg = Timezone("America/Indiana/Petersburg") AmericaIndianaTellCity = Timezone("America/Indiana/TellCity") AmericaIndianaVevay = Timezone("America/Indiana/Vevay") AmericaIndianaVincennes = Timezone("America/Indiana/Vincennes") AmericaIndianaWinamac = Timezone("America/Indiana/Winamac") AmericaIndianapolis = Timezone("America/Indianapolis") AmericaInuvik = Timezone("America/Inuvik") AmericaIqaluit = Timezone("America/Iqaluit") AmericaJamaica = Timezone("America/Jamaica") AmericaJujuy = Timezone("America/Jujuy") AmericaJuneau = Timezone("America/Juneau") AmericaKentuckyLouisville = Timezone("America/Kentucky/Louisville") AmericaKentuckyMonticello = Timezone("America/Kentucky/Monticello") AmericaKnoxIN = Timezone("America/KnoxIN") AmericaKralendijk = Timezone("America/Kralendijk") AmericaLaPaz = Timezone("America/LaPaz") AmericaLima = Timezone("America/Lima") AmericaLosAngeles = Timezone("America/LosAngeles") AmericaLouisville = Timezone("America/Louisville") AmericaLowerPrinces = Timezone("America/LowerPrinces") AmericaMaceio = Timezone("America/Maceio") AmericaManagua = Timezone("America/Managua") AmericaManaus = Timezone("America/Manaus") AmericaMarigot = Timezone("America/Marigot") AmericaMartinique = Timezone("America/Martinique") AmericaMatamoros = Timezone("America/Matamoros") AmericaMazatlan = Timezone("America/Mazatlan") AmericaMendoza = Timezone("America/Mendoza") AmericaMenominee = Timezone("America/Menominee") AmericaMerida = Timezone("America/Merida") AmericaMetlakatla = Timezone("America/Metlakatla") AmericaMexicoCity = Timezone("America/MexicoCity") AmericaMiquelon = Timezone("America/Miquelon") AmericaMoncton = Timezone("America/Moncton") AmericaMonterrey = Timezone("America/Monterrey") AmericaMontevideo = Timezone("America/Montevideo") AmericaMontreal = Timezone("America/Montreal") AmericaMontserrat = Timezone("America/Montserrat") AmericaNassau = Timezone("America/Nassau") AmericaNewYork = Timezone("America/NewYork") AmericaNipigon = Timezone("America/Nipigon") AmericaNome = Timezone("America/Nome") AmericaNoronha = Timezone("America/Noronha") AmericaNorthDakotaBeulah = Timezone("America/NorthDakota/Beulah") AmericaNorthDakotaCenter = Timezone("America/NorthDakota/Center") AmericaNorthDakotaNewSalem = Timezone("America/NorthDakota/NewSalem") AmericaOjinaga = Timezone("America/Ojinaga") AmericaPanama = Timezone("America/Panama") AmericaPangnirtung = Timezone("America/Pangnirtung") AmericaParamaribo = Timezone("America/Paramaribo") AmericaPhoenix = Timezone("America/Phoenix") AmericaPortofSpain = Timezone("America/PortofSpain") AmericaPort = Timezone("America/Port") AmericaPortoAcre = Timezone("America/PortoAcre") AmericaPortoVelho = Timezone("America/PortoVelho") AmericaPuertoRico = Timezone("America/PuertoRico") AmericaPuntaArenas = Timezone("America/PuntaArenas") AmericaRainyRiver = Timezone("America/RainyRiver") AmericaRankinInlet = Timezone("America/RankinInlet") AmericaRecife = Timezone("America/Recife") AmericaRegina = Timezone("America/Regina") AmericaResolute = Timezone("America/Resolute") AmericaRioBranco = Timezone("America/RioBranco") AmericaRosario = Timezone("America/Rosario") AmericaSantaIsabel = Timezone("America/SantaIsabel") AmericaSantarem = Timezone("America/Santarem") AmericaSantiago = Timezone("America/Santiago") AmericaSantoDomingo = Timezone("America/SantoDomingo") AmericaSaoPaulo = Timezone("America/SaoPaulo") AmericaScoresbysund = Timezone("America/Scoresbysund") AmericaShiprock = Timezone("America/Shiprock") AmericaSitka = Timezone("America/Sitka") AmericaStBarthelemy = Timezone("America/StBarthelemy") AmericaStJohns = Timezone("America/StJohns") AmericaStKitts = Timezone("America/StKitts") AmericaStLucia = Timezone("America/StLucia") AmericaStThomas = Timezone("America/StThomas") AmericaStVincent = Timezone("America/StVincent") AmericaSwiftCurrent = Timezone("America/SwiftCurrent") AmericaTegucigalpa = Timezone("America/Tegucigalpa") AmericaThule = Timezone("America/Thule") AmericaThunderBay = Timezone("America/ThunderBay") AmericaTijuana = Timezone("America/Tijuana") AmericaToronto = Timezone("America/Toronto") AmericaTortola = Timezone("America/Tortola") AmericaVancouver = Timezone("America/Vancouver") AmericaVirgin = Timezone("America/Virgin") AmericaWhitehorse = Timezone("America/Whitehorse") AmericaWinnipeg = Timezone("America/Winnipeg") AmericaYakutat = Timezone("America/Yakutat") AmericaYellowknife = Timezone("America/Yellowknife") AntarcticaCasey = Timezone("Antarctica/Casey") AntarcticaDavis = Timezone("Antarctica/Davis") AntarcticaDumontDUrville = Timezone("Antarctica/DumontDUrville") AntarcticaMacquarie = Timezone("Antarctica/Macquarie") AntarcticaMawson = Timezone("Antarctica/Mawson") AntarcticaMcMurdo = Timezone("Antarctica/McMurdo") AntarcticaPalmer = Timezone("Antarctica/Palmer") AntarcticaRothera = Timezone("Antarctica/Rothera") AntarcticaSouthPole = Timezone("Antarctica/SouthPole") AntarcticaSyowa = Timezone("Antarctica/Syowa") AntarcticaTroll = Timezone("Antarctica/Troll") AntarcticaVostok = Timezone("Antarctica/Vostok") ArcticLongyearbyen = Timezone("Arctic/Longyearbyen") AsiaAden = Timezone("Asia/Aden") AsiaAlmaty = Timezone("Asia/Almaty") AsiaAmman = Timezone("Asia/Amman") AsiaAnadyr = Timezone("Asia/Anadyr") AsiaAqtau = Timezone("Asia/Aqtau") AsiaAqtobe = Timezone("Asia/Aqtobe") AsiaAshgabat = Timezone("Asia/Ashgabat") AsiaAshkhabad = Timezone("Asia/Ashkhabad") AsiaAtyrau = Timezone("Asia/Atyrau") AsiaBaghdad = Timezone("Asia/Baghdad") AsiaBahrain = Timezone("Asia/Bahrain") AsiaBaku = Timezone("Asia/Baku") AsiaBangkok = Timezone("Asia/Bangkok") AsiaBarnaul = Timezone("Asia/Barnaul") AsiaBeirut = Timezone("Asia/Beirut") AsiaBishkek = Timezone("Asia/Bishkek") AsiaBrunei = Timezone("Asia/Brunei") AsiaCalcutta = Timezone("Asia/Calcutta") AsiaChita = Timezone("Asia/Chita") AsiaChoibalsan = Timezone("Asia/Choibalsan") AsiaChongqing = Timezone("Asia/Chongqing") AsiaChungking = Timezone("Asia/Chungking") AsiaColombo = Timezone("Asia/Colombo") AsiaDacca = Timezone("Asia/Dacca") AsiaDamascus = Timezone("Asia/Damascus") AsiaDhaka = Timezone("Asia/Dhaka") AsiaDili = Timezone("Asia/Dili") AsiaDubai = Timezone("Asia/Dubai") AsiaDushanbe = Timezone("Asia/Dushanbe") AsiaFamagusta = Timezone("Asia/Famagusta") AsiaGaza = Timezone("Asia/Gaza") AsiaHarbin = Timezone("Asia/Harbin") AsiaHebron = Timezone("Asia/Hebron") AsiaHoChiMinh = Timezone("Asia/HoChiMinh") AsiaHongKong = Timezone("Asia/HongKong") AsiaHovd = Timezone("Asia/Hovd") AsiaIrkutsk = Timezone("Asia/Irkutsk") AsiaIstanbul = Timezone("Asia/Istanbul") AsiaJakarta = Timezone("Asia/Jakarta") AsiaJayapura = Timezone("Asia/Jayapura") AsiaJerusalem = Timezone("Asia/Jerusalem") AsiaKabul = Timezone("Asia/Kabul") AsiaKamchatka = Timezone("Asia/Kamchatka") AsiaKarachi = Timezone("Asia/Karachi") AsiaKashgar = Timezone("Asia/Kashgar") AsiaKathmandu = Timezone("Asia/Kathmandu") AsiaKatmandu = Timezone("Asia/Katmandu") AsiaKhandyga = Timezone("Asia/Khandyga") AsiaKolkata = Timezone("Asia/Kolkata") AsiaKrasnoyarsk = Timezone("Asia/Krasnoyarsk") AsiaKualaLumpur = Timezone("Asia/KualaLumpur") AsiaKuching = Timezone("Asia/Kuching") AsiaKuwait = Timezone("Asia/Kuwait") AsiaMacao = Timezone("Asia/Macao") AsiaMacau = Timezone("Asia/Macau") AsiaMagadan = Timezone("Asia/Magadan") AsiaMakassar = Timezone("Asia/Makassar") AsiaManila = Timezone("Asia/Manila") AsiaMuscat = Timezone("Asia/Muscat") AsiaNovokuznetsk = Timezone("Asia/Novokuznetsk") AsiaNovosibirsk = Timezone("Asia/Novosibirsk") AsiaOmsk = Timezone("Asia/Omsk") AsiaOral = Timezone("Asia/Oral") AsiaPhnomPenh = Timezone("Asia/PhnomPenh") AsiaPontianak = Timezone("Asia/Pontianak") AsiaPyongyang = Timezone("Asia/Pyongyang") AsiaQatar = Timezone("Asia/Qatar") AsiaQyzylorda = Timezone("Asia/Qyzylorda") AsiaRangoon = Timezone("Asia/Rangoon") AsiaRiyadh = Timezone("Asia/Riyadh") AsiaSaigon = Timezone("Asia/Saigon") AsiaSakhalin = Timezone("Asia/Sakhalin") AsiaSamarkand = Timezone("Asia/Samarkand") AsiaSeoul = Timezone("Asia/Seoul") AsiaShanghai = Timezone("Asia/Shanghai") AsiaSingapore = Timezone("Asia/Singapore") AsiaSrednekolymsk = Timezone("Asia/Srednekolymsk") AsiaTaipei = Timezone("Asia/Taipei") AsiaTashkent = Timezone("Asia/Tashkent") AsiaTbilisi = Timezone("Asia/Tbilisi") AsiaTehran = Timezone("Asia/Tehran") AsiaTelAviv = Timezone("Asia/TelAviv") AsiaThimbu = Timezone("Asia/Thimbu") AsiaThimphu = Timezone("Asia/Thimphu") AsiaTokyo = Timezone("Asia/Tokyo") AsiaTomsk = Timezone("Asia/Tomsk") AsiaUjungPandang = Timezone("Asia/UjungPandang") AsiaUlaanbaatar = Timezone("Asia/Ulaanbaatar") AsiaUlanBator = Timezone("Asia/UlanBator") AsiaUrumqi = Timezone("Asia/Urumqi") AsiaUst = Timezone("Asia/Ust") AsiaVientiane = Timezone("Asia/Vientiane") AsiaVladivostok = Timezone("Asia/Vladivostok") AsiaYakutsk = Timezone("Asia/Yakutsk") AsiaYangon = Timezone("Asia/Yangon") AsiaYekaterinburg = Timezone("Asia/Yekaterinburg") AsiaYerevan = Timezone("Asia/Yerevan") AtlanticAzores = Timezone("Atlantic/Azores") AtlanticBermuda = Timezone("Atlantic/Bermuda") AtlanticCanary = Timezone("Atlantic/Canary") AtlanticCapeVerde = Timezone("Atlantic/CapeVerde") AtlanticFaeroe = Timezone("Atlantic/Faeroe") AtlanticFaroe = Timezone("Atlantic/Faroe") AtlanticJanMayen = Timezone("Atlantic/JanMayen") AtlanticMadeira = Timezone("Atlantic/Madeira") AtlanticReykjavik = Timezone("Atlantic/Reykjavik") AtlanticSouthGeorgia = Timezone("Atlantic/SouthGeorgia") AtlanticStHelena = Timezone("Atlantic/StHelena") AtlanticStanley = Timezone("Atlantic/Stanley") AustraliaACT = Timezone("Australia/ACT") AustraliaAdelaide = Timezone("Australia/Adelaide") AustraliaBrisbane = Timezone("Australia/Brisbane") AustraliaBrokenHill = Timezone("Australia/BrokenHill") AustraliaCanberra = Timezone("Australia/Canberra") AustraliaCurrie = Timezone("Australia/Currie") AustraliaDarwin = Timezone("Australia/Darwin") AustraliaEucla = Timezone("Australia/Eucla") AustraliaHobart = Timezone("Australia/Hobart") AustraliaLHI = Timezone("Australia/LHI") AustraliaLindeman = Timezone("Australia/Lindeman") AustraliaLordHowe = Timezone("Australia/LordHowe") AustraliaMelbourne = Timezone("Australia/Melbourne") AustraliaNorth = Timezone("Australia/North") AustraliaNSW = Timezone("Australia/NSW") AustraliaPerth = Timezone("Australia/Perth") AustraliaQueensland = Timezone("Australia/Queensland") AustraliaSouth = Timezone("Australia/South") AustraliaSydney = Timezone("Australia/Sydney") AustraliaTasmania = Timezone("Australia/Tasmania") AustraliaVictoria = Timezone("Australia/Victoria") AustraliaWest = Timezone("Australia/West") AustraliaYancowinna = Timezone("Australia/Yancowinna") BrazilAcre = Timezone("Brazil/Acre") BrazilDeNoronha = Timezone("Brazil/DeNoronha") BrazilEast = Timezone("Brazil/East") BrazilWest = Timezone("Brazil/West") CanadaAtlantic = Timezone("Canada/Atlantic") CanadaCentral = Timezone("Canada/Central") CanadaEastern = Timezone("Canada/Eastern") CanadaMountain = Timezone("Canada/Mountain") CanadaNewfoundland = Timezone("Canada/Newfoundland") CanadaPacific = Timezone("Canada/Pacific") CanadaSaskatchewan = Timezone("Canada/Saskatchewan") CanadaYukon = Timezone("Canada/Yukon") CET = Timezone("CET") ChileContinental = Timezone("Chile/Continental") ChileEasterIsland = Timezone("Chile/EasterIsland") CST6CDT = Timezone("CST6CDT") Cuba = Timezone("Cuba") EET = Timezone("EET") Egypt = Timezone("Egypt") Eire = Timezone("Eire") EST = Timezone("EST") EST5EDT = Timezone("EST5EDT") EtcGMT = Timezone("Etc/GMT") EtcGMTPlus0 = Timezone("Etc/GMT+0") EtcGMTPlus1 = Timezone("Etc/GMT+1") EtcGMTPlus10 = Timezone("Etc/GMT+10") EtcGMTPlus11 = Timezone("Etc/GMT+11") EtcGMTPlus12 = Timezone("Etc/GMT+12") EtcGMTPlus2 = Timezone("Etc/GMT+2") EtcGMTPlus3 = Timezone("Etc/GMT+3") EtcGMTPlus4 = Timezone("Etc/GMT+4") EtcGMTPlus5 = Timezone("Etc/GMT+5") EtcGMTPlus6 = Timezone("Etc/GMT+6") EtcGMTPlus7 = Timezone("Etc/GMT+7") EtcGMTPlus8 = Timezone("Etc/GMT+8") EtcGMTPlus9 = Timezone("Etc/GMT+9") EtcGMT0 = Timezone("Etc/GMT0") EtcGMTMinus0 = Timezone("Etc/GMT-0") EtcGMTMinus1 = Timezone("Etc/GMT-1") EtcGMTMinus10 = Timezone("Etc/GMT-10") EtcGMTMinus11 = Timezone("Etc/GMT-11") EtcGMTMinus12 = Timezone("Etc/GMT-12") EtcGMTMinus13 = Timezone("Etc/GMT-13") EtcGMTMinus14 = Timezone("Etc/GMT-14") EtcGMTMinus2 = Timezone("Etc/GMT-2") EtcGMTMinus3 = Timezone("Etc/GMT-3") EtcGMTMinus4 = Timezone("Etc/GMT-4") EtcGMTMinus5 = Timezone("Etc/GMT-5") EtcGMTMinus6 = Timezone("Etc/GMT-6") EtcGMTMinus7 = Timezone("Etc/GMT-7") EtcGMTMinus8 = Timezone("Etc/GMT-8") EtcGMTMinus9 = Timezone("Etc/GMT-9") EtcGreenwich = Timezone("Etc/Greenwich") EtcUCT = Timezone("Etc/UCT") EtcUniversal = Timezone("Etc/Universal") EtcUTC = Timezone("Etc/UTC") EtcZulu = Timezone("Etc/Zulu") EuropeAmsterdam = Timezone("Europe/Amsterdam") EuropeAndorra = Timezone("Europe/Andorra") EuropeAstrakhan = Timezone("Europe/Astrakhan") EuropeAthens = Timezone("Europe/Athens") EuropeBelfast = Timezone("Europe/Belfast") EuropeBelgrade = Timezone("Europe/Belgrade") EuropeBerlin = Timezone("Europe/Berlin") EuropeBratislava = Timezone("Europe/Bratislava") EuropeBrussels = Timezone("Europe/Brussels") EuropeBucharest = Timezone("Europe/Bucharest") EuropeBudapest = Timezone("Europe/Budapest") EuropeBusingen = Timezone("Europe/Busingen") EuropeChisinau = Timezone("Europe/Chisinau") EuropeCopenhagen = Timezone("Europe/Copenhagen") EuropeDublin = Timezone("Europe/Dublin") EuropeGibraltar = Timezone("Europe/Gibraltar") EuropeGuernsey = Timezone("Europe/Guernsey") EuropeHelsinki = Timezone("Europe/Helsinki") EuropeIsleofMan = Timezone("Europe/IsleofMan") EuropeIstanbul = Timezone("Europe/Istanbul") EuropeJersey = Timezone("Europe/Jersey") EuropeKaliningrad = Timezone("Europe/Kaliningrad") EuropeKiev = Timezone("Europe/Kiev") EuropeKirov = Timezone("Europe/Kirov") EuropeLisbon = Timezone("Europe/Lisbon") EuropeLjubljana = Timezone("Europe/Ljubljana") EuropeLondon = Timezone("Europe/London") EuropeLuxembourg = Timezone("Europe/Luxembourg") EuropeMadrid = Timezone("Europe/Madrid") EuropeMalta = Timezone("Europe/Malta") EuropeMariehamn = Timezone("Europe/Mariehamn") EuropeMinsk = Timezone("Europe/Minsk") EuropeMonaco = Timezone("Europe/Monaco") EuropeMoscow = Timezone("Europe/Moscow") AsiaNicosia = Timezone("Asia/Nicosia") EuropeOslo = Timezone("Europe/Oslo") EuropeParis = Timezone("Europe/Paris") EuropePodgorica = Timezone("Europe/Podgorica") EuropePrague = Timezone("Europe/Prague") EuropeRiga = Timezone("Europe/Riga") EuropeRome = Timezone("Europe/Rome") EuropeSamara = Timezone("Europe/Samara") EuropeSanMarino = Timezone("Europe/SanMarino") EuropeSarajevo = Timezone("Europe/Sarajevo") EuropeSaratov = Timezone("Europe/Saratov") EuropeSimferopol = Timezone("Europe/Simferopol") EuropeSkopje = Timezone("Europe/Skopje") EuropeSofia = Timezone("Europe/Sofia") EuropeStockholm = Timezone("Europe/Stockholm") EuropeTallinn = Timezone("Europe/Tallinn") EuropeTirane = Timezone("Europe/Tirane") EuropeTiraspol = Timezone("Europe/Tiraspol") EuropeUlyanovsk = Timezone("Europe/Ulyanovsk") EuropeUzhgorod = Timezone("Europe/Uzhgorod") EuropeVaduz = Timezone("Europe/Vaduz") EuropeVatican = Timezone("Europe/Vatican") EuropeVienna = Timezone("Europe/Vienna") EuropeVilnius = Timezone("Europe/Vilnius") EuropeVolgograd = Timezone("Europe/Volgograd") EuropeWarsaw = Timezone("Europe/Warsaw") EuropeZagreb = Timezone("Europe/Zagreb") EuropeZaporozhye = Timezone("Europe/Zaporozhye") EuropeZurich = Timezone("Europe/Zurich") GB = Timezone("GB") GBEire = Timezone("GB-Eire") GMT = Timezone("GMT") GMTPlus0 = Timezone("GMT+0") GMT0 = Timezone("GMT0") GMTMinus0 = Timezone("GMT-0") Greenwich = Timezone("Greenwich") Hongkong = Timezone("Hongkong") HST = Timezone("HST") Iceland = Timezone("Iceland") IndianAntananarivo = Timezone("Indian/Antananarivo") IndianChagos = Timezone("Indian/Chagos") IndianChristmas = Timezone("Indian/Christmas") IndianCocos = Timezone("Indian/Cocos") IndianComoro = Timezone("Indian/Comoro") IndianKerguelen = Timezone("Indian/Kerguelen") IndianMahe = Timezone("Indian/Mahe") IndianMaldives = Timezone("Indian/Maldives") IndianMauritius = Timezone("Indian/Mauritius") IndianMayotte = Timezone("Indian/Mayotte") IndianReunion = Timezone("Indian/Reunion") Iran = Timezone("Iran") Israel = Timezone("Israel") Jamaica = Timezone("Jamaica") Japan = Timezone("Japan") Kwajalein = Timezone("Kwajalein") Libya = Timezone("Libya") MET = Timezone("MET") MexicoBajaNorte = Timezone("Mexico/BajaNorte") MexicoBajaSur = Timezone("Mexico/BajaSur") MexicoGeneral = Timezone("Mexico/General") MST = Timezone("MST") MST7MDT = Timezone("MST7MDT") NZ = Timezone("NZ") NZCHAT = Timezone("NZ-CHAT") PacificApia = Timezone("Pacific/Apia") PacificAuckland = Timezone("Pacific/Auckland") PacificBougainville = Timezone("Pacific/Bougainville") PacificChatham = Timezone("Pacific/Chatham") PacificChuuk = Timezone("Pacific/Chuuk") PacificEaster = Timezone("Pacific/Easter") PacificEfate = Timezone("Pacific/Efate") PacificEnderbury = Timezone("Pacific/Enderbury") PacificFakaofo = Timezone("Pacific/Fakaofo") PacificFiji = Timezone("Pacific/Fiji") PacificFunafuti = Timezone("Pacific/Funafuti") PacificGalapagos = Timezone("Pacific/Galapagos") PacificGambier = Timezone("Pacific/Gambier") PacificGuadalcanal = Timezone("Pacific/Guadalcanal") PacificGuam = Timezone("Pacific/Guam") PacificHonolulu = Timezone("Pacific/Honolulu") PacificJohnston = Timezone("Pacific/Johnston") PacificKiritimati = Timezone("Pacific/Kiritimati") PacificKosrae = Timezone("Pacific/Kosrae") PacificKwajalein = Timezone("Pacific/Kwajalein") PacificMajuro = Timezone("Pacific/Majuro") PacificMarquesas = Timezone("Pacific/Marquesas") PacificMidway = Timezone("Pacific/Midway") PacificNauru = Timezone("Pacific/Nauru") PacificNiue = Timezone("Pacific/Niue") PacificNorfolk = Timezone("Pacific/Norfolk") PacificNoumea = Timezone("Pacific/Noumea") PacificPagoPago = Timezone("Pacific/PagoPago") PacificPalau = Timezone("Pacific/Palau") PacificPitcairn = Timezone("Pacific/Pitcairn") PacificPohnpei = Timezone("Pacific/Pohnpei") PacificPonape = Timezone("Pacific/Ponape") PacificPortMoresby = Timezone("Pacific/PortMoresby") PacificRarotonga = Timezone("Pacific/Rarotonga") PacificSaipan = Timezone("Pacific/Saipan") PacificSamoa = Timezone("Pacific/Samoa") PacificTahiti = Timezone("Pacific/Tahiti") PacificTarawa = Timezone("Pacific/Tarawa") PacificTongatapu = Timezone("Pacific/Tongatapu") PacificTruk = Timezone("Pacific/Truk") PacificWake = Timezone("Pacific/Wake") PacificWallis = Timezone("Pacific/Wallis") PacificYap = Timezone("Pacific/Yap") Poland = Timezone("Poland") Portugal = Timezone("Portugal") PRC = Timezone("PRC") PST8PDT = Timezone("PST8PDT") ROC = Timezone("ROC") ROK = Timezone("ROK") Singapore = Timezone("Singapore") Turkey = Timezone("Turkey") UCT = Timezone("UCT") Universal = Timezone("Universal") USAlaska = Timezone("US/Alaska") USAleutian = Timezone("US/Aleutian") USArizona = Timezone("US/Arizona") USCentral = Timezone("US/Central") USEastern = Timezone("US/Eastern") USEastIndiana = Timezone("US/East-Indiana") USHawaii = Timezone("US/Hawaii") USIndianaStarke = Timezone("US/Indiana-Starke") USMichigan = Timezone("US/Michigan") USMountain = Timezone("US/Mountain") USPacific = Timezone("US/Pacific") USPacificNew = Timezone("US/Pacific-New") USSamoa = Timezone("US/Samoa") UTC = Timezone("UTC") WET = Timezone("WET") WSU = Timezone("W-SU") Zulu = Timezone("Zulu") )
All possible Timezones, which are supported by Go's "time" library
const WeekInDays = 7
WeekInDays is the integer value how many days a week has
Variables ¶
This section is empty.
Functions ¶
func FormatTokenIsNotMapped ¶
FormatTokenIsNotMapped errors the given formatToken
Types ¶
type DateTime ¶
DateTime reflects time.Time and adds functionality of this library
func DateTimeFromTime ¶
DateTimeFromTime returns a DateTime with given time.Time
func FromUnixTimestamp ¶
FromUnixTimestamp gets the DateTime from given unix timestamp. The returned Datetime has the UTC timezone
func NewDateTime ¶
func NewDateTime( year int, month int, day int, hour int, minute int, second int, nanosecond int, timezone Timezone, ) DateTime
NewDateTime returns a new DateTime in the timezone given
func NewLocalDateTime ¶
func NewLocalDateTime( year int, month int, day int, hour int, minute int, second int, nanosecond int, ) DateTime
NewLocalDateTime creates a new DateTime in Local (system) timezone
func NewUTCDateTime ¶
func NewUTCDateTime( year int, month int, day int, hour int, minute int, second int, nanosecond int, ) DateTime
NewUTCDateTime returns a new DateTime with timezone in UTC
func NowInTimezone ¶
NowInTimezone returns the current DateTime in given timezone
func ParseInTimezone ¶
ParseInTimezone a string value with given format into a new DateTime in given timezone
func (DateTime) CTimeFormat ¶
CTimeFormat the current DateTime to ctime standard
Example: Sat Feb 15 12:12:12 2020
func (DateTime) CeilDay ¶
CeilDay returns a DateTime with all values to "ceil" except year, month, day, minute, second
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 23:59:59.999999999
func (DateTime) CeilHour ¶
CeilHour returns a DateTime with all values to "ceil" except year, month, day, hour
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 12:59:59.999999999
func (DateTime) CeilMinute ¶
CeilMinute returns a DateTime with all values to "ceil" except year, month, day, hour, minute
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 12:12:59.999999999
func (DateTime) CeilMonth ¶
CeilMonth returns a DateTime with all values to "ceil" except year, month
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-31 23:59:59.999999999
func (DateTime) CeilSecond ¶
CeilSecond returns a DateTime with all values to "ceil" except year, month, day, hour, minute, second
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 12:12:12.999999999
func (DateTime) CeilWeek ¶ added in v1.0.3
CeilWeek returns a DateTime with all values to "ceil" of current DateTime's week except year, month
For Example:
2012-12-12 12:12:12.123456789 (wednesday) becomes 2012-12-16 23:59:59:123456789 (sunday)
func (DateTime) CeilYear ¶
CeilYear returns a DateTime with all values to "ceil" except year
For Example:
2012-05-12 12:12:12.123456789 becomes 2012-12-31 23:59:59.999999999
func (DateTime) FloorDay ¶
FloorDay returns a DateTime with all values to "floor" except year, month, day
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 00:00:00.00000000
func (DateTime) FloorHour ¶
FloorHour returns a DateTime with all values to "floor" except year, month, day, hour
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 12:00:00.00000000
func (DateTime) FloorMinute ¶
FloorMinute returns a DateTime with all values to "floor" except year, month, day, hour, minute
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-12 12:12:00.00000000
func (DateTime) FloorMonth ¶
FloorMonth returns a DateTime with all values to "floor" except year, month
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-01 00:00:00.00000000
func (DateTime) FloorSecond ¶
FloorSecond returns a DateTime with all values to "floor" except year, month, day, hour, minute, second
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-12-31 12:12:12.00000000
func (DateTime) FloorWeek ¶ added in v1.0.3
FloorWeek returns a DateTime with all values to "floor" of current DateTime's week except year, month
For Example:
2012-12-12 12:12:12.123456789 (wednesday) becomes 2012-12-10 00:00:00.000000000 (monday)
func (DateTime) FloorYear ¶
FloorYear returns a DateTime with all values to "floor" except year
For Example:
2012-12-12 12:12:12.123456789 becomes 2012-01-01 00:00:00.00000000
func (DateTime) GoString ¶
GoString of the DateTime it will use the IsoFormat The GoString method is used to print values passed as an operand to a %#v format.
func (DateTime) InTimezone ¶
InTimezone sets the current DateTime in the given Timezone and returns a new DateTime
func (DateTime) IsoCalendar ¶
IsoCalendar returns three int values with (year, month, day)
func (DateTime) IsoFormat ¶
IsoFormat the current DateTime into ISO-8601 standard
For Example:
2017-07-14T02:40:00.000000
func (DateTime) IsoFormatTZ ¶
IsoFormatTZ the current DateTime into ISO-8601 standard and current timezone info
For Example:
2017-07-14T02:40:00.000000+0200
func (DateTime) Nanosecond ¶
Nanosecond of current DateTime as int
func (DateTime) Replace ¶
func (dt DateTime) Replace(year int, month int, day int, hour int, minute int, second int, nanosecond int) DateTime
Replace will set the year, month, day, hour, minute, second, and nanosecond of current DateTime and returns a new DateTime
func (DateTime) ReplaceDay ¶
ReplaceDay will set the day of current DateTime and returns a new DateTime
func (DateTime) ReplaceHour ¶
ReplaceHour will set the hour of current DateTime and returns a new DateTime
func (DateTime) ReplaceMinute ¶
ReplaceMinute will set the minute of current DateTime and returns a new DateTime
func (DateTime) ReplaceMonth ¶
ReplaceMonth will set the month of current DateTime and returns a new DateTime
func (DateTime) ReplaceNanosecond ¶
ReplaceNanosecond will set the nanosecond of current DateTime and returns a new DateTime
func (DateTime) ReplaceSecond ¶
ReplaceSecond will set the second of current DateTime and returns a new DateTime
func (DateTime) ReplaceYear ¶
ReplaceYear will set the year of current DateTime and returns a new DateTime
func (DateTime) Shift ¶
func (dt DateTime) Shift(years int, months int, days int, hours int, minutes int, seconds int, nanoseconds int) DateTime
Shift adds or subtracts years, months, days, hours, minutes, seconds, and nanoseconds of current DateTime and returns a new DateTime Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftDays ¶
ShiftDays adds or subtracts days Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftHours ¶
ShiftHours adds or subtracts hours Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftMicroSeconds ¶
ShiftMicroSeconds adds or subtracts microseconds Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftMilliSeconds ¶
ShiftMilliSeconds adds or subtracts milliseconds Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftMinutes ¶
ShiftMinutes adds or subtracts minutes Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftMonths ¶
ShiftMonths adds or subtracts months Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftNanoseconds ¶
ShiftNanoseconds adds or subtracts nanoseconds in current DateTime and returns a new DateTime Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftSeconds ¶
ShiftSeconds adds or subtracts seconds Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftWeeks ¶ added in v1.0.3
ShiftWeeks add or subtracts weeks Add is a positive integer Subtract is a negative integer
func (DateTime) ShiftYears ¶
ShiftYears adds or subtracts years in current DateTime and returns a new DateTime Add is a positive integer Subtract is a negative integer
func (DateTime) SpanDay ¶
SpanDay returns the start and end DateTime of current day span
For Example:
2012-12-12 12:12:12:123456789 becomes (2012-12-12 00:00:00.000000000, 2012-12-12 23:59:59.999999999)
func (DateTime) SpanHour ¶
SpanHour returns the start and end DateTime of current hour span
For Example:
2012-12-12 12:12:12:123456789 becomes (2012-12-12 12:00:00.000000000, 2012-12-12 12:59:59.999999999)
func (DateTime) SpanMinute ¶
SpanMinute returns the start and end DateTime of current minute span
For Example:
2012-12-12 12:12:12:123456789 becomes (2012-12-12 12:12:00.000000000, 2012-12-12 12:12:59.999999999)
func (DateTime) SpanMonth ¶
SpanMonth returns the start and end DateTime of current month span
For Example:
2012-12-12 12:12:12:123456789 becomes (2012-12-01 00:00:00.000000000, 2012-12-31 23:59:59.999999999)
func (DateTime) SpanSecond ¶
SpanSecond returns the start and end DateTime of current second span
For Example:
2012-12-12 12:12:12:123456789 becomes (2012-12-12 12:12:12.000000000, 2012-12-12 12:12:12.999999999)
func (DateTime) SpanWeek ¶ added in v1.0.3
SpanWeek returns the start and end DateTime of current week span
For Example:
2012-12-12 12:12:12.123456789 becomes (2012-12-10 00:00:00.00000000, 2012-12-16 23:59:59.999999999)
func (DateTime) SpanYear ¶
SpanYear returns the start and end DateTime of current year span
For Example:
2012-05-12 12:12:12:123456789 becomes (2012-01-01 00:00:00.000000000, 2012-12-31 23:59:59.999999999)
func (DateTime) String ¶
String of the DateTime it will use the IsoFormat It defines the “native” format for that value. The String method is used to print values passed as an operand to any format that accepts a string or to an unformatted printer such as Print.
func (DateTime) UnixTimestamp ¶
UnixTimestamp returns the unix timestamp as int64
type FormatToken ¶
type FormatToken string
FormatToken helps to hold all possible tokens for parsing and formatting