Description
Provides a breakdown of a point in time based on a time zone.
Inheritance
TimePoint does not inherit from any object type.
Constructors
- TimePoint(): Creates a TimePoint populated with the current
moment in time and UTC timezone.
- TimePoint( TimePoint v ): Creates a TimePoint copying the
values from "v".
- TimePoint( TimeZone tz ): Creates a TimePoint populated with
the current moment in time and uses "tz" as the timezone.
- TimePoint( TimeMillis v, TimeZone tz ): Creates a TimePoint
populated with the moment in time from "v" and uses "tz" as the timezone. TimeT
can implicitly convert to a TimeMillis, allowing this function to be used with
TimeT values as well.
Methods
- int
getFullYear(): returns the year
- int
getMonth(): returns the month: 0-11
- int
getDate(): returns the date: 1-31
- int
getHours(): returns the hour of day: 0-23
- int
getMinutes(): returns the minutes: 0-59
- int
getSeconds(): returns the seconds: 0-59
- int
getMilliseconds(): returns the milliseconds: 0-999
- int
getDayOfWeek(): returns the day of week: 0-6 (Sunday=0)
- int
getDayOfYear(): returns the day of year: 1-366
- void
set( TimeMillis v, TimeZone tz ): Populates a TimePoint with
the moment in time from "v" and uses "tz" as the timezone. TimeT can implicitly
convert to a TimeMillis, allowing this function to be used with TimeT values as
well.
- TimeZone
getTimeZone(): Returns the TimeZone that the TimePoint has
been initialized with.
- TimeMillis
to_TimeMillis(): Returns the TimeMillis value that the
TimePoint was initialized with. This value is what is used for all comparison
operators such as "==".
Example
var v1 = TimeMillis( 1516667515006ll ).ToTimePoint( CreateTimeZone("MST") );
var dayOfWeek = v1.getDayOfWeek();
var fr = CreateLocale("fr"); // Create French locale
Ext.WriteStream( fr.GetDayOfWeekName(dayOfWeek) ); // Output day of week using French locale
Result:
lundi
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.