There is only one scenario where this sort of adjustment makes sense, which is a technique known as "epoch shifting". It will still use the local time zone of where it runs, for any function that requires a local time, such as. You can't change the Date object's behavior to get it to use a different time zone just by adding or subtracting an offset. Passing it this california_ms timestamp is actually just picking a different point in time. When the Date constructor is passed a numeric timestamp, it must be in terms of UTC. Any function such as your getCaliforniatimezoneOffsetMS would need to have the timestamp passed in as a parameter to be effective.Īnd finally the date object let california_date: Date = new Date(california_ms) Also, unlike India, California observes daylight saving time, so part of the year the offset will be 480 (UTC-8), and part of the year the offset will be 420 (UTC-7). Now add california's timezone offset value let california_ms = utc_ms + getCaliforniaTimezoneOffsetMS()Īgain, adding an offset is incorrect. (also, the abbreviation is UTC, not UTS.) getTime() already returns a UTC based timestamp. The local time zone is applied when functions and properties that need local time are called - not when the Date object is created.Īdd it's timezone offset value let uts_ms = india_date.getTime() + india_date.getTimezoneOffset() Keep in mind that internally, the Date object only tracks a UTC based timestamp. If it is run on a computer with a different time zone, it will reflect that time zone instead. You have named this variable india_date, but the Date object will only reflect India if the code is run on a computer set to India's time zone. There are no Daylight Saving Time clock changes.First, let's talk about the code in your question. India observes India Standard Time all year. This time zone was declared India Standard Time (IST) in 1947, though Calcutta Time was used until 1948 and Bombay Time until 1955. Eventually, in 1905, the meridian near Mirzapur (82☃3’E) was picked as the standard time for the whole country. In 1884 two time zones were used in India: Calcutta Time (UTC+5:53:28) and Bombay Time (UTC+4:51:20)-just over an hour apart. In 1802, British astronomer John Goldingham at the East India Company established time in Chennai as GMT+5:30. India had multiple time zones in the past. The implementation has yet to be legally formalized. In 2018, the CSIR-National Physical Laboratory (CSIR-NPL) and the National Measurement Institute (NMI) of India proposed implementing two time zones in India: IST-I (UTC+5:30) and IST-II (UTC+6:30) in the northeast. But for now, it seems like the drawbacks of one time zone do not outweigh the benefits of two. As seen from the tea gardens, early sunrise causes loss of sleep and productivity in locations with less daylight hours, and early sunset can lead to higher energy consumption. There are a few drawbacks of keeping the one time zone. Tea Garden Time, translated as “Chai Bagan Time,” was introduced by the British tea companies to increase daylight work hours and thus productivity and is still in use today. In this part of the country, sunrise can come as early as 4:00 (4 am) IST in the morning and sunset at 16:00 (4 pm) IST in the afternoon. There the clocks are unofficially set one hour ahead of IST (UTC+6:30). Tea Garden Time is an informal time zone used in India's northeastern state Assam. If the country were to base its time zones on mean solar time, it would have three time zones, but since it only has one, the Sun rises almost 90 minutes earlier in Dong in the far east than in Guar Mota in the west. It spans nearly 30 degrees longitude (68☇'E to 97☂5'E). India is a large country that stretches almost 3000 kilometers (1864 miles) from west to east. However, the UTC+5:30 offset has been used as the local standard time in India since 1906. The country has officially observed India Standard Time (IST) since 1947. Time Zone Currently Being Used in India Offset Business Date to Date (exclude holidays).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |