Jump to content

Date convert from mdb


Recommended Posts

Hi,

Does anyopne have an idea how to get an MSAccess datum wich is a date-time/; result comes back as "33456.76589" etc as a detailed Julian-type number, and I want it as not only date, but the time component?

I guess I can write a routine to do this, but I wonder if there is an easy command in autoIt, or if I can retrieve it from Access already converted?

thanks, randall

Link to comment
Share on other sites

  • Developers

This should be close ... the date calculation needs some more testing

#include<date.au3>
$Input_date = 33456.76589
$date_part = Int($Input_date)
;
Global $iYear,$iMonth, $iDay
Global $Base = _DateToDayValue(1900,01,01) - 1.5
_DayValueToDate($date_part+$Base,$iYear,$iMonth, $iDay)
$Date =  $iMonth & "/" & $iDay & "/" & $iYear
ConsoleWrite('@@ Debug(7) : $Date = ' & $Date & @lf & '>Error code: ' & @error & @lf);### Debug Console

$time_part = int(($Input_date - $date_part) * 24 * 60 * 60 *1000)
Global $iHH,$iMM, $iSS
_TicksToTime($time_part,$iHH,$iMM,$iSS)
$time =  $iHH & ":" & $iMM & ":" & $iSS
ConsoleWrite('@@ Debug(15) : $time = ' & $time & @lf & '>Error code: ' & @error & @lf);### Debug Console

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi,

That was quick!

Thanks to both; I'll have a look..

Best, Randall

PS

How to Convert Julian Days to Dates in Access and Back

that link only talks about the Date component, which is easy in AutoIt anyway.. Edited by randallc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...