![]() |
|
|||
|
Re: [addon] BTV Command Line Tools
Quote:
I really just want to be able to set the sortabletime field with the command line tools, is there a way to read or write these XML files with date/time values other than the jumble of integers? |
|
|||
|
Re: [addon] BTV Command Line Tools
OK I answered my own question kinda. i really haven't programmed in a while. For anyone else trying to do this. You have to convert the filetime string into hex, and divide the hex in to two 32 bit strings, then convert each hex string to longs in order to populate the two words.
|
|
|||
|
Re: [addon] BTV Command Line Tools
Here's the VBA/VB6 solution, maybe it will be helpful to others. It uses date functions found here, hex functions here, and longtounsigned here.
Code:
Function date2ft(d As Date) As String
Dim ft As FileTime
Dim hHex As String
Dim lhex As String
Call SerialTimeToFileTime(d, ft)
hHex = DecToHex(LongToUnsigned(ft.dwHighDateTime))
lhex = DecToHex(LongToUnsigned(ft.dwLowDateTime))
Do Until Len(hHex) >= 8
hHex = "0" & hHex
Loop
Do Until Len(lhex) >= 8
lhex = "0" & lhex
Loop
'now both high and low hexes are 8 chars=32 bit
date2ft = Application.WorksheetFunction.Text(HexToDec(hHex & lhex), "0")
End Function
|
|
|||
|
Re: [addon] BTV Command Line Tools
Here's a much simpler date/time conversion using VBScript (and no external functions):
Code:
'adjusted for EST, change -4 to +2 for GMT
dateResult = DateAdd("h", intTargetStart/36000000000 + 2, "1/1/1601")
strDate = Year(dateResult) & "-" & Month(dateResult) & "-" & Day(dateResult)
strTime = FormatDateTime(dateResult,3)
intTargetStart = 128963268000000000 strDate = "2009-09-08" strTime = "09:00:00 PM" |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command Line | DRH | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 2 | 09-05-2003 02:11 AM |
| command line options? | cadet | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 3 | 06-22-2003 12:08 PM |