Results 1 to 4 of 4
  1. #1
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211

    Question Access VBA Programming UTC format

    Any suggestions on VBA code for formatting Access dates and time to UTC (Coordinated Universal Time) format instead of the standard Access format of =Date() or =Now()?

    The idea is to transfer the database backend to MySQL, which natively stores by default all dates and times in UTC format and returns to original user format when retrieved.

    The issue is =Date() and =Now() uses the database frontend computer date and time settings when creating and modifying records.



    I anticipate this being a problem when multiple time zones are involved (i.e. madness when auditing records); therefore, I would like to standardize the date and time setting at the database frontend.

    Thanks in advance for any insight!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you would not change the 'format' of the table field for date. it stays as date, but you not use =Date(),or Now.
    you would have another field TimeZone.
    and a tTimeZone table to lookup the difference.
    the date stored is calculated from the tTimeZone.UTC offset.
    Attached Thumbnails Attached Thumbnails timezone.jpg  

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I have not used MYSQL as a backend to Access for years. I would review the MySQL manual regarding MS Access as a front end and using the ODBC connector. If MySQL is using UTC as a default storage, I would think the ODBC connector might handle the "translation", or you might try a pass through procedure. A little testing will confirm or not.

    You may find info here.
    Good luck.

  4. #4
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Thanks for the input. I will evaluate everything a bit more and then post the solution I use herein.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-29-2015, 09:36 AM
  2. Replies: 1
    Last Post: 12-24-2014, 03:49 PM
  3. Replies: 0
    Last Post: 11-19-2014, 05:47 AM
  4. Replies: 3
    Last Post: 09-07-2013, 04:59 PM
  5. Replies: 4
    Last Post: 03-12-2013, 06:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums