+ Reply to Thread
Results 1 to 6 of 6

Convert UTC or AEST to local time precisely

  1. #1
    Registered User
    Join Date
    08-07-2024
    Location
    SYDNEY
    MS-Off Ver
    Microsoft 365 (32 bit)
    Posts
    3

    Convert UTC or AEST to local time precisely

    Hello. I am struggling to find a formula that will convert UTC time to local Australian time, taking into account whether the date/time falls within Australian Eastern Standard Time (+10) or Australian Eastern Daylight Time (+11).

    I have tried so many different variations from multiple sources and i'm not winning. I'm a bit frustrated and need a beautiful mind to help me.

    I need the formula to recognise the following:
    1st Sunday in October at exactly 2:00am - switch to daylight saving time (i.e. forward one hour)
    1st Sunday in April at exactly 3:00am - switch to eastern standard time (i.e. back one hour)
    I also need the formula to adapt to all years, past and future.

    I'm not sure why none of the formulas suggested on many many forums haven't worked. Possibly because the UTC date falls 10 / 11 hours behind, making the conversion time a Saturday afternoon, not a Sunday morning. I'm thinking it would be easier to do it in two steps and convert to AEST first, then use a formula to recognise if it falls within specified time zone range.

    I have attached a spreadsheet with columns for all relevant time zones and a column for what the local time should equate to.

    Please help.
    Attached Files Attached Files
    Last edited by heyjojo; 08-07-2024 at 08:43 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Convert UTC or AEST to local time precisely

    Based on your idea, and using new function available in Excel 365 which allows for not using dummy columns, but do multi-step calculations in one cell:
    You may use such solution in G2 (and copy down):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note that while formula is rather long, the addres of A2 (source date and time) is used only once, so formula could be easily copied elsewhere and source cell has to be changed only in one place.

    Or let's write this formula in more clear way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    So first AEST is calculated,
    then first sundays of April and October at 2am (in AEST)
    then 1 hour is added to AEST if AEST converted date is "on winter side": before 1st Sun Apr or after 1st Sun Oct, .
    Attached Files Attached Files
    Last edited by Kaper; 08-07-2024 at 10:30 AM.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    08-07-2024
    Location
    SYDNEY
    MS-Off Ver
    Microsoft 365 (32 bit)
    Posts
    3

    Re: Convert UTC or AEST to local time precisely

    I wish I met you sooner Kaper. You're amazing. Thank you for taking the time to help me and explain everything so well. This formula has saved me countless hours of manual data manipulation. I'm very grateful.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Convert UTC or AEST to local time precisely

    Just in case - your test file contained only full hours.
    Check the formula if it works fine also on 4 moments:
    1st Sunday in October at 1:30am and 1st Sunday in April at 2:30am and two cases one hour later than these two.

    And as for my input: you sugessted the way to go. I just offered a vehicle to go that way :-)


    Final comments: Thanks for marking threasd as SOLVED. If the test from 1st paragraph of this post go wrong, mark thread as unSOLVED again. It would be lovely if you could also click on a star in lower-left corner of my post (and accept in the pop-up window) to add me some reputation.
    Last edited by Kaper; 08-08-2024 at 05:05 AM.

  5. #5
    Registered User
    Join Date
    08-07-2024
    Location
    SYDNEY
    MS-Off Ver
    Microsoft 365 (32 bit)
    Posts
    3

    Re: Convert UTC or AEST to local time precisely

    The formula still works a treat with different time variations. I'm going to incorporate the formula into a macro this weekend and see how it goes with parsing larger data sets. I'm optimistic. Thanks again for solving this last piece of the puzzle for me.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Convert UTC or AEST to local time precisely

    Glad to hear so.

    If you encounter problems with macro, try forum again :-)

    But for such case, I'd suggest starting a new thread and only provide a link to this one.

    BTW. LET formula by it's structure is perfectly well suited to be used as a starting point for macro, as we have variables calculated and then resused and finally the main calculation based on previously found variables.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Convert time from one time zone to local time.
    By glide2131 in forum Excel General
    Replies: 4
    Last Post: 04-12-2024, 02:53 PM
  2. [SOLVED] Converting incorrect time in Zulu to local present time
    By propertie in forum Excel General
    Replies: 5
    Last Post: 10-31-2019, 04:49 PM
  3. how to convert GMT to any local timezone
    By bsuren in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2019, 10:58 PM
  4. [SOLVED] EPOCH Time Conversion to local time and daylight savings time (DST)
    By cwwazy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2015, 02:14 PM
  5. Converting text to different timezones. GMT, AEDT, EST etc
    By labogola in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-27-2014, 01:30 AM
  6. I need to format various strings (numbers, dates) precisely
    By durandal05 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2008, 08:55 PM
  7. Looking a formula to convert local currency to USD by matching com
    By Dinesh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2006, 03:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1