Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:40:37+00:00 2026-06-15T11:40:37+00:00

Say I have the string 1 December 2012, 8:00:00 I know that it is

  • 0

Say I have the string "1 December 2012, 8:00:00"

I know that it is AEST time (regardless where the server is), with whatever daylight saving state at that time (1st Dec), but I want to store it in the database as UTC.

How do I convert it to UTC, treating the string as AEST regardless where the server is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:40:38+00:00Added an answer on June 15, 2026 at 11:40 am

    You may first initialize a System.DateTime which gets the DateTime from the string you’ve specified above. Then, you may use System.DateTime.ToUniversalTime() which converts the value of the current System.DateTime object to Coordinated Universal Time and store it in the database.

    Example

    DateTime AEST = DateTime.Parse("1 December 2012, 8:00:00"); //Initialize a new DateTime of name AEST which gets a System.DateTime from 1 December 2012, 8:00:00
    DateTime UTC = AEST.ToUniversalTime(); //Initialize a new DateTime of name UTC which converts the value from AEST to Coordinated Universal Time
    System.Diagnostics.Debug.WriteLine(UTC.ToString()); //Writes 12/1/2012 6:00:00 AM
    

    Notice: If you are willing to convert a time from one time zone to another, you may use TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo, destinationTimeZone) where dateTime is the DateTime you would like to convert, sourceTimeZone is the time zone of the DateTime you would like to convert and destinationTimeZone is the time zone you would to get from dateTime

    Example

    string _date = "1 December 2012, 8:00:00"; //Initializes a new string of name _date as "1 December 2012, 8:00:00"
    string targetTimeZone = "W. Australia Standard Time"; //Initializes a new string of name targetTimeZone as "W. Australia Standard Time"
    DateTime sourceDateTime = DateTime.Parse(_date); //Initializes a new DateTime of name sourceDateTime which gets a valid DateTIme object from 1 December 2012, 8:00:00
    DateTime AEST = TimeZoneInfo.ConvertTime(sourceDateTime, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(targetTimeZone)); //Initializes a new DateTime which converts the time zone from sourceDateTime assuming that sourceDateTime's TimeZone is the local time zone of the machine to an W. Australia Standard Time time zone of name AEST  
    

    This will convert 1 December 2012, 8:00:00 assuming that its time zone is the local time zone of the machine (e.g Egypt Standard Time: (GMT+02:00) Cairo) to W. Australia Standard Time: (GMT+08:00) Perth which will be 12/1/2012 2:00:00 PM.

    For list of time zones, see Microsoft Time Zone Index Values

    Thanks,

    I hope you find this helpful 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have a string like that: [{updated_at: 2012-03-02 21:06:01, fetched_at: 2012-03-02 21:28:37.728840, description:
Say i have a string that i need to evaluate in javascript such as
Let's say I have String Table that have a few strings (like mother, father,
Say I have a string that is a url with params in it: http://www.google.com/search?hl=en&client=firefox-a&hs=zlX&rls=org.mozilla%3Aen-US%3Aofficial&q=something&cts=1279154269301&aq=f&aqi=&aql=&oq=&gs_rfai=
Let's say that I have date as a string, like: 02-12-2011 How can I
I have an xml in the form of a string. Let's say that the
Say I have a string with comma delimited values enclosed in single quotes that
Say i have a string like that title: \u041e\u0434\u0440\u0438\u043d\u044f-\u0423\u0440\u0431\u043e\u0432\u0430 ... What would be the
Say you have this string: ABCDEFGH And you want to reverse it so that
lets say that we have: string list[]= {12.34.56.78,55.34.5,23.44.5} I want the user to enter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.