View Single Post
Old 30th November 2005, 20:04   #67  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Great you know VB .NET, maybe you can help me to tackle this issue. I don't get it since I took the date for all applications using universal time, needless to to say here it works.

Code:
Public Class VirtualDubModPackage
    Inherits Package

    Public Sub New()
        Name = "VirtualDubMod"
        Filename = "VirtualDubMod.exe"
        Version = "1.5.10.1 build 2439"
        Website = "http://virtualdubmod.sourceforge.net"
        Description = "VirtualDubMod is derived from VirtualDub and supports additional formats."
        VersionDate = New DateTime(2004, 3, 8)
        DownloadFilename = "VirtualDubMod_1.5.10.1_build_2439.zip"
        TreeFolder = "Video Processing"
    End Sub

    Public Overrides Function IsRequired() As Boolean
        Return TypeOf p.VideoEncoder Is VirtualDubEncoder AndAlso _
            Not DirectCast(p.VideoEncoder, VirtualDubEncoder).UseVirtualDub
    End Function
End Class

Private Sub DebugCopyDateCodeClick(ByVal sender As Object, ByVal e As EventArgs)
    Dim dt As DateTime = FileHelp.GetLastWriteTime(ActivePackage.GetPath(False)).ToUniversalTime
    Clipboard.SetDataObject("New DateTime(" + dt.Year.ToString + ", " + dt.Month.ToString + ", " + dt.Day.ToString + ")", True)
End Sub
I also realize this code is a little bit dusty since .NET 2.0 has many new methods like File.GetLastWriteTimeUtc or Clipboards.SetText.

edit: the bug is what you spotted VersionDate get converted to universal date (it is already universal date)

Last edited by stax76; 30th November 2005 at 20:40.
stax76 is offline