SnapStream Forums

Go Back   SnapStream Forums > SnapStream Developer Network > Beyond TV Downloads
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #31 (permalink)  
Old 08-24-2009, 01:15 PM
Registered User
 
Join Date: Oct 2005
Posts: 30
Re: [addon] BTV Command Line Tools

Quote:
Originally Posted by Kilrsat View Post
"Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC)."
So that sounds like it's FILETIME. I'm a little unclear how to get it into that struct defined there, to use any tools to manipulate it. I tried using these tools here but I wasn't able to either get or set any filetime's that made sense. For example, I was able to see what a particular time field was with btvshowinfo, but converting that into a filetime didn't get me the value that was in the xml file.

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?
Reply With Quote
  #32 (permalink)  
Old 08-24-2009, 09:29 PM
Registered User
 
Join Date: Oct 2005
Posts: 30
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.
Reply With Quote
  #33 (permalink)  
Old 08-25-2009, 07:20 AM
Registered User
 
Join Date: Oct 2005
Posts: 30
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
Reply With Quote
  #34 (permalink)  
Old 09-08-2009, 09:52 PM
Registered User
 
Join Date: Nov 2005
Posts: 15
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)
Example:
intTargetStart = 128963268000000000
strDate = "2009-09-08"
strTime = "09:00:00 PM"
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -6. The time now is 02:45 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0 RC1
©2004-2006 Snapstream Media
You Rated this Thread: