From Wikipedia, the free encyclopedia
Computing desk
< December 9 << Nov | December | Jan >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


December 10 Information

Converting Datetime String to Datetime in Access

In the Access database that was the subject of the last two questions, the records have a string of the form '1904 GMT, 11 October 2021' or '1721 GMT, 16 November'. (This is being taken from the SMTP header of spam that I have received.) Is there a function or technique in Access that I can use to convert it to an Access datetime? Robert McClenon ( talk) 17:34, 10 December 2021 (UTC) reply

As a technique it's about generating a double-precision floating-point number following the model of increasing or decreasing by one for each day departing from December 30, 1899, which is thus set worth floating point: zero, then within the same floating-point number having the time in the day evolving from .0 to .99999 so that you divide .99999 by 24 to get one hour AM and you add that value to 0.0 in order to code 1 AM December 30, 1899 for example. One drawback you will need a supplementary indicator to ensure any departure from GMT (and from UTC, as well). If you need to convert in order to automate calculations the missing year in your second example will make the result unreliable too. -- Askedonty ( talk) 22:13, 10 December 2021 (UTC) reply
Is there a function that I can use? McClenon mobile ( talk) 22:07, 16 December 2021 (UTC) reply
From a quick internet search, CDate() seems to accept a few different formats, but maybe not the ones you have. Tigraan Click here for my talk page ("private" contact) 14:48, 17 December 2021 (UTC) reply
From Wikipedia, the free encyclopedia
Computing desk
< December 9 << Nov | December | Jan >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


December 10 Information

Converting Datetime String to Datetime in Access

In the Access database that was the subject of the last two questions, the records have a string of the form '1904 GMT, 11 October 2021' or '1721 GMT, 16 November'. (This is being taken from the SMTP header of spam that I have received.) Is there a function or technique in Access that I can use to convert it to an Access datetime? Robert McClenon ( talk) 17:34, 10 December 2021 (UTC) reply

As a technique it's about generating a double-precision floating-point number following the model of increasing or decreasing by one for each day departing from December 30, 1899, which is thus set worth floating point: zero, then within the same floating-point number having the time in the day evolving from .0 to .99999 so that you divide .99999 by 24 to get one hour AM and you add that value to 0.0 in order to code 1 AM December 30, 1899 for example. One drawback you will need a supplementary indicator to ensure any departure from GMT (and from UTC, as well). If you need to convert in order to automate calculations the missing year in your second example will make the result unreliable too. -- Askedonty ( talk) 22:13, 10 December 2021 (UTC) reply
Is there a function that I can use? McClenon mobile ( talk) 22:07, 16 December 2021 (UTC) reply
From a quick internet search, CDate() seems to accept a few different formats, but maybe not the ones you have. Tigraan Click here for my talk page ("private" contact) 14:48, 17 December 2021 (UTC) reply

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook