Timezone conversion in a Google spreadsheet

后端 未结 5 1191
长发绾君心
长发绾君心 2021-01-01 10:09

I know this looks simple.

In a Google spreadsheet, I have a column where I enter time in one timezone (GMT) And another column should automatically get time in anoth

5条回答
  •  暖寄归人
    2021-01-01 10:17

    I had the same problem (convert Manila Time to Sydney Time and automatically adjust for daylight saving time) when I found this page.

    I didn't want to have a custom function but I found that, in Sydney, AEST (Australian Eastern Standard Time) starts on the first Sunday of April and AEDT (Australian Eastern Daylight Time) starts on the first Sunday of October.

    So I thought, if I could find a formula that detects whether a date falls between the first Sunday of April and first Sunday of October (Standard Time) then I can automatically add 1 hour to the usual 2 hours to Manila time during Daylight Saving Time (dates falling outside the two dates) to have Sydney Time.

    These two Excel solutions worked fine in Google Sheets:

    • How You Can Determine the First Sunday in a Month in Excel
    • How to determine if a date falls between two dates or on weekend in Excel

    First Sunday of April this year (A1):

    =CONCATENATE("4/1/",Year(today()))+CHOOSE(WEEKDAY(CONCATENATE("4/1/",Year(today())),1),7,6,5,4,3,2,1)
    

    First Sunday of October this year (A2):

    =CONCATENATE("10/1/",year(today()))+CHOOSE(WEEKDAY(CONCATENATE("10/1/",year(today())),1),7,6,5,4,3,2,1)
    

    DST detector (A3) — if a date falls outside these two dates, it's DST in Sydney:

    =IF(AND(today()>A1,today()

    Time in Sydney (A4):

    =NOW()+TIME(IF(A3="AEDT",3,2),0,0)
    

    NOW() can be changed to any time format for tabulation:

提交回复
热议问题