WLJS LogoWLJS Notebook

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.

Examples

Get the current local time:

LocalTime[]

Get the current time in New York:

LocalTime[Entity["City", {"NewYork", "NewYork", "UnitedStates"}]]

Convert a time to a different location:

LocalTime[Entity["City", {"Tokyo", "Tokyo", "Japan"}], Now]

Please visit the official Wolfram Language Reference for more details.

On this page