LocalTime

LocalTime[]

gives a DateObject corresponding to the current local time at the current geo location.

LocalTime[loc]

gives the current local time at the geo location specified by loc.

LocalTime[loc,time]

gives the local time corresponding to the date object time at the geo location loc.

LocalTime[loc,time,func]

uses func to determine what to return for extended geographic regions.

Details

  • The geo location loc can be specified by a GeoPosition object or by giving an appropriate Entity object.
  • LocalTime by default returns a DateObject in the time zone corresponding to loc.
  • TimeZoneConvert can be used to obtain results for other time zones.
  • Possible settings for func include:
  • Automatic (default)result for significant point in region (e.g. capital city)
    Centerresult for geographic center of the region
    Minearliest time in the region
    Maxlatest time in the region
    Listlist of times in the region

Examples

open allclose all

Basic Examples  (4)

Get the current local time:

Find the current local time in Paris:

Find the local time in Paris corresponding to a specific date:

Get a list of all current times in Russia:

Scope  (3)

For LocalTime[loc], loc may be any Entity expression with a location property on Earth:

For entities with extended geographic regions, LocalTime[loc] uses a significant location within the region(such as a capital city) as the default when multiple local times may be observed within the region:

For extended geographic regions, different reference points may be used when determining local time:

Properties & Relations  (2)

LocalTime[] is equivalent to Now:

LocalTime[loc] gives back time in the time zone given by TimeZoneOffset[loc]:

Wolfram Research (2014), LocalTime, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalTime.html.

Text

Wolfram Research (2014), LocalTime, Wolfram Language function, https://reference.wolfram.com/language/ref/LocalTime.html.

CMS

Wolfram Language. 2014. "LocalTime." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LocalTime.html.

APA

Wolfram Language. (2014). LocalTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LocalTime.html

BibTeX

@misc{reference.wolfram_2024_localtime, author="Wolfram Research", title="{LocalTime}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/LocalTime.html}", note=[Accessed: 12-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_localtime, organization={Wolfram Research}, title={LocalTime}, year={2014}, url={https://reference.wolfram.com/language/ref/LocalTime.html}, note=[Accessed: 12-December-2024 ]}