lon2tzo

From DavinciWiki
Jump to: navigation, search

Description

Returns coordinated time offset for input (east) longitude

Arguments and Return Values

Parameters: Scalar (number) specifying the longitude for which to find the time zone offset

Return Value: A string specifying the time zone offset

Usage

Syntax: lon2tzo(longitude)

The longitude should be increasing eastward. Therefore the eastern hemisphere has longitudes ranging from 0 to 180, and the western hemisphere has longitudes ranging from 180 to 360, or equivalently from -180 to 0.

The time zone offset is the difference between local time and coordinated time (UTC for Earth, MTC for Mars, etc.). It is generally negative for the western hemisphere and positive for the eastern hemisphere.

Note that this function assumes that time zones are each exactly fifteen degrees wide, centered on multiples of fifteen degrees longitude, so that each time zone is an integer number of hours ahead of or behind coordinated time. This function also assumes that the date line is at 180 degrees. Note that these assumptions are not necessarily true for time zones on Earth, whose boundaries typically are more complex and are based on political boundaries. Do not assume that the returned time zone is correct for a location on Earth. This function is designed to quickly find a time zone for a location on Mars or another uninhabited body. Unlike the time zones on Earth, those returned by this function are always integers.

Time zone offsets are often designated as hours and minutes, but this function only uses hours. For example, the time zone MTC-07:00 is represented here as just "-7". Many dependent functions automatically add the "UTC" prefix (or "MTC" for Mars) when displaying a time zone, but this function itself does not.

The input must be scalar.

The most important thing this function does is simply to add "+" before the number, if needed. Its main use is in marstimelocal, to find Local Mean Zonal Time.

When lon2tzo() is entered without any arguments, it prints its description, as shown below.

Examples

dv> lon2tzo()

Finds coordinated time offset, given an east longitude
Scalar inputs only - no arrays!
Returns coordinated time offset as string
This function assumes that time zones are each 15 degrees wide,
 centered on multiples of 15 degrees longitude, so that each zone
 is an integer number of hours ahead or behind coordinated time
This function also assumes that the date line is at 180 degrees
lon2tzo(east longitude) returns string specifying time zone offset
S.Marshall 08-13-2008

0
dv> lon2tzo(0)
"+0"
dv> lon2tzo(90)
"+6"
dv> lon2tzo(179)
"+12"
dv> lon2tzo(180)
"-12"
dv> lon2tzo(181)
"-12"
dv> lon2tzo(270)
"-6"

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 11-18-2009
Modified On: 06-01-2010

Personal tools