Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Time zone
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Programming languages === ==== Java ==== While most application software will use the underlying operating system for time zone and daylight saving time rule information, [[Java (programming language)|the Java Platform]], from version 1.3.1, has maintained its own database of time zone and daylight saving time rule information. This database is updated whenever time zone or daylight saving time rules change. [[Oracle Corporation|Oracle]] provides an updater tool for this purpose.<ref>{{cite web |url=https://www.oracle.com/java/technologies/javase/tzupdater-readme.html |title=Timezone Updater Tool |publisher=Oracle Java Technologies |access-date=November 21, 2024}}</ref> As an alternative to the information bundled with the Java Platform, programmers may choose to use the Joda-Time library.<ref>{{cite web |url=http://joda-time.sourceforge.net/ |title=Joda-Time |publisher=Joda-time.sourceforge.net |access-date=December 5, 2011 |archive-date=December 3, 2011 |archive-url=https://web.archive.org/web/20111203213457/http://joda-time.sourceforge.net/ |url-status=live }}</ref> This library includes its own data based on the IANA time zone database.<ref>{{cite web |url=http://www.twinsun.com/tz/tz-link.htm |title=tz database |publisher=Twinsun.com |date=December 26, 2007 |access-date=December 5, 2011 |url-status=dead |archive-url=https://web.archive.org/web/20120623013511/http://www.twinsun.com/tz/tz-link.htm |archive-date=June 23, 2012 }}</ref> As of Java 8 there is a new date and time API that can help with converting times.<ref>{{Cite web|url=https://docs.oracle.com/javase/tutorial/datetime/|title=Trail: Date Time (The Javaβ’ Tutorials)|website=docs.oracle.com}}</ref> ==== JavaScript ==== Traditionally, there was very little in the way of time zone support for [[JavaScript]]. Essentially the programmer had to extract the UTC offset by instantiating a time object, getting a GMT time from it, and differencing the two. This does not provide a solution for more complex daylight saving variations, such as divergent DST directions between northern and southern hemispheres. ECMA-402, the standard on Internationalization API for JavaScript, provides ways of formatting Time Zones.<ref>{{Cite web | title = ECMAScript 2015 Internationalization API Specification | publisher = ECMA International | date = June 2015 | access-date = September 4, 2019 | url = https://www.ecma-international.org/ecma-402/2.0/#sec-time-zone-names | archive-date = October 26, 2019 | archive-url = https://web.archive.org/web/20191026140400/https://www.ecma-international.org/ecma-402/2.0/#sec-time-zone-names | url-status = live }}</ref> However, due to size constraint, some implementations or distributions do not include it.<ref>{{Cite web | title = Internationalization Support | work = Node.js v12.10.0 Documentation | access-date = September 4, 2019 | url = https://nodejs.org/api/intl.html#intl_disable_all_internationalization_features_none | archive-date = August 28, 2019 | archive-url = https://web.archive.org/web/20190828234745/https://nodejs.org/api/intl.html#intl_disable_all_internationalization_features_none | url-status = live }}</ref> ==== Perl ==== The DateTime object in [[Perl]] supports all entries in the [[IANA time zone database]] and includes the ability to get, set and convert between time zones.<ref>{{cite web |url=https://metacpan.org/pod/DateTime |title=DateTime |publisher=METACPAN |access-date=April 14, 2014 |archive-date=March 29, 2014 |archive-url=https://web.archive.org/web/20140329001557/https://metacpan.org/pod/DateTime |url-status=live }}</ref> ==== PHP ==== The DateTime objects and related functions have been compiled into the [[PHP]] core since 5.2. This includes the ability to get and set the default script time zone, and DateTime is aware of its own time zone internally. PHP.net provides extensive documentation on this.<ref>{{cite web |url=http://www.php.net/manual/en/book.datetime.php |title=DateTime |publisher=Php.net |access-date=December 5, 2011 |archive-date=November 22, 2011 |archive-url=https://web.archive.org/web/20111122174518/http://www.php.net/manual/en/book.datetime.php |url-status=live }}</ref> As noted there, the most current time zone database can be implemented via the [[PEAR#PECL|PECL]] timezonedb. ==== Python ==== The standard module datetime included with [[Python (programming language)|Python]] stores and operates on the time zone information class tzinfo. The third party pytz module provides access to the full IANA time zone database.<ref>{{cite web |url=http://pytz.sourceforge.net/ |title=pytz module |publisher=Pytz.sourceforge.net |access-date=December 5, 2011 |archive-date=November 30, 2011 |archive-url=https://web.archive.org/web/20111130085600/http://pytz.sourceforge.net/ |url-status=live }}</ref> Negated time zone offset in seconds is stored time.timezone and time.altzone attributes. From Python 3.9, the zoneinfo module introduces timezone management without need for third party module.<ref>{{cite web |url=https://docs.python.org/3/library/zoneinfo.html |title=zoneinfo module |publisher=www.python.org |access-date=February 8, 2021 |archive-date=February 7, 2021 |archive-url=https://web.archive.org/web/20210207193618/https://docs.python.org/3/library/zoneinfo.html |url-status=live }}</ref> ==== Smalltalk ==== Each [[Smalltalk]] dialect comes with its own built-in classes for dates, times and timestamps, only a few of which implement the DateAndTime and Duration classes as specified by the ANSI Smalltalk Standard. [[VisualWorks]] provides a TimeZone class that supports up to two annually recurring offset transitions, which are assumed to apply to all years (same behavior as Windows time zones). [[Squeak]] provides a Timezone class that does not support any offset transitions. [[Dolphin Smalltalk]] does not support time zones at all. For full support of the tz database (zoneinfo) in a Smalltalk application (including support for any number of annually recurring offset transitions, and support for different intra-year offset transition rules in different years) the third-party, open-source, ANSI-Smalltalk-compliant Chronos Date/Time Library is available for use with any of the following Smalltalk dialects: VisualWorks, Squeak, Gemstone, or Dolphin.<ref>{{Cite web|url=http://www.chronos-st.org/|archiveurl=https://web.archive.org/web/20140405043602/http://www.chronos-st.org/|url-status=dead|title=chronos-st β Keeping up with time|date=October 21, 2024|archivedate=April 5, 2014}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Time zone
(section)
Add topic