Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: l)ragon on August 03, 2003, 06:45 PM

Title: [VB] TimeStamp - for you
Post by: l)ragon on August 03, 2003, 06:45 PM

Private Type SYSTEMTIME
     wYear         As Integer
     wMonth        As Integer
     wDayOfWeek    As Integer
     wDay          As Integer
     wHour         As Integer
     wMinute       As Integer
     wSecond       As Integer
     wMilliseconds As Integer
End Type

Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)

Public Function TimeStamp() As String
   Dim SysT As SYSTEMTIME
       GetLocalTime SysT
       TimeStamp = "*" & SysT.wDay & "/" & _
                        SysT.wMonth & "/" & _
                        SysT.wYear & " " & _
                        SysT.wHour & ":" & _
                        SysT.wMinute & ":" & _
                        SysT.wSecond & "* "
End Function


Go nuts.  :P
Title: Re:[VB] TimeStamp - for you
Post by: K on August 03, 2003, 07:36 PM
how 'bout

Public Function TimeStamp() As String
       TimeStamp = "*" & Format(Now, "dd/MM/yyyy hh:nn:ss AM/PM") & "* "
End Function


What were you doing with that API call?  ::)
Title: Re:[VB] TimeStamp - for you
Post by: l)ragon on August 03, 2003, 08:49 PM
had nothing better to do  :P
Title: Re:[VB] TimeStamp - for you
Post by: iago on August 04, 2003, 02:06 AM
You make the API call to get SysT, then you still use Now..
Title: Re:[VB] TimeStamp - for you
Post by: l)ragon on August 04, 2003, 03:57 AM
my screwup 8(

thx for pointing that out +1 to you ^^
Title: Re:[VB] TimeStamp - for you
Post by: iago on August 04, 2003, 05:16 AM
Thanks, now it's a little more useful, if for nothing else then for something to learn off of :)
Title: Re:[VB] TimeStamp - for you
Post by: FuzZ on March 11, 2004, 03:04 PM
Ah Thank you!
I was trying to figure out how to get milliseconds on my timestamp ;D
Title: Re:[VB] TimeStamp - for you
Post by: Eric on March 11, 2004, 04:54 PM
Quote from: FuzZ on March 11, 2004, 03:04 PM
Ah Thank you!
I was trying to figure out how to get milliseconds on my timestamp ;D

Goodjob reviving a 7 month old topic.
Title: Re:[VB] TimeStamp - for you
Post by: Adron on March 11, 2004, 05:04 PM
Quote from: FuzZ on March 11, 2004, 03:04 PM
Ah Thank you!
I was trying to figure out how to get milliseconds on my timestamp ;D

Good job looking at old posts instead of reasking the same question! I assume you used the search feature?
Title: Re:[VB] TimeStamp - for you
Post by: CrAz3D on March 11, 2004, 05:49 PM
ooh, search, gotta love it.  Too bad it doesn't search other forums too, or something of the sort that has a larger info scope.
Title: Re:[VB] TimeStamp - for you
Post by: R.a.B.B.i.T on March 12, 2004, 07:07 PM
Advanced Search
Title: Re:[VB] TimeStamp - for you
Post by: l)ragon on March 14, 2004, 01:36 AM
Quote from: FuzZ on March 11, 2004, 03:04 PM
Ah Thank you!
I was trying to figure out how to get milliseconds on my timestamp ;D
Your welcome.