com >> Reading millisecnds from Current datatime

by Su Man » Thu, 22 Sep 2005 16:44:13 GMT

Hi,

How should I extract milliseconds from Current DataeTime (Now function).
Please help me in doing this.

Thanks,
Su Man




com >> Reading millisecnds from Current datatime

by Norm Cook » Thu, 22 Sep 2005 21:16:24 GMT



Something like:

Option Explicit
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As
SYSTEMTIME)
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 Sub Form_Load()
Dim st As SYSTEMTIME
GetSystemTime st
'format anyway you desire
Debug.Print "Day of Week: " & WeekdayName(st.wDayOfWeek + 1) 'zero based
Debug.Print "Year: " & st.wYear
Debug.Print "Month: " & st.wMonth
Debug.Print "Day: " & st.wDay
Debug.Print "Hour: " & st.wHour
Debug.Print "Minute: " & st.wMinute
Debug.Print "Second: " & st.wSecond
Debug.Print "Millisecond: " & st.wMilliseconds
End Sub








com >> Reading millisecnds from Current datatime

by Su Man » Fri, 23 Sep 2005 18:19:35 GMT

Hi,

Th time being displayed is not the time what I am seeing in my computer. It
is showing the time some 6 hrs back.

Now time in my system is 15:48 but the code returns 10:16.
Can you please tell my why is it so? And how should I get the correct time?

thanks,
Subramanian DS









Reading millisecnds from Current datatime

by Ken Halter » Fri, 23 Sep 2005 22:32:20 GMT





Time zone.... The function you're using doesn't account for time zone info.

The header for your post says.....

Subject: Re: Reading millisecnds from Current datatime
Date: Fri, 23 Sep 2005 15:49:35 +0530

That "+0530" tells the system to adjust the time by 5 1/2 hours to "sync"
your system with the rest of the world.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..




Reading millisecnds from Current datatime

by Karl E. Peterson » Sat, 24 Sep 2005 01:01:37 GMT




Like Ken said, that's a universal time you're seeing, and you need to localize it (if
that's what you want). The easiest way to do that is using
SystemTimeToTzSpecificLocalTime. Just pass NULL (ByVal 0&) as the first parameter.
--
Working Without a .NET?
http://classicvb.org/petition




Similar Threads

1. QUestion about SQL Server datatime and VB 6 - Visual Basic/VB

2. Reading the current Namespace.Class, Assemble at runtime

Reading the current Namespace.Class, Assemble at runtime


I am trying to get the Assemble, Namespace and Class name of a form at
runtime. I have several assembles and namespaces in my app, I need to
determine what namespace.class, assemble I am currently processing.

Thanks 
Mike Walters

3. Q: read current message in VB - Microsoft Office Outlook

4. Interlocked Functions vs VB Reading Current Value

I have run into the VB6 nuance where it does not reliably read current value 
of a VarPtr exposed variable. I can see the foreign process successfully 
incrementing the value all day but my client is not picking up the change. I 
tried using Boolean = Variable but without success. Since I will be looking 
at this variable from within a loop what would be an efficient API to read 
the current value directly from memory?

Thanks

Desi 


5. VBA: Read current Table's Autofit - Word VBA

6. Read current settings using VBA

I need to check current settings and selected options using VBA.
However, I can't find some options/settings in the MS Project VBA object 
model.

Collaboration Options
- "Publish New and Changed Assignments" updates resources' assignments when
- On every save, publish the following information to Project Server: New 
and Changed Assignments (I can read Project summary, but not this option)

Save Options:
- AutoSave, Interval, ...
As far as I know, this is not possible

Published fields (Tools -> customize -> Published fields)
- everything about custom fields (what fields, task or assignment, let 
resource change value, ...)

If you know how to read (not write, I know how to do that) all or some of 
these options please let me know! Or if you know it is imposible, also let me 
know.

Thank you!

7. Find out current log-on user and the current IP programmatically

8. Get current file name and path from current word doc

Hello,

I am working with putting hyperlinks in an Access database field (setup
for hyperlinks) and wanted to know if anyone has written (or knows of a
way) a macro to get the following two objects from the current workspace
window, first: file name, and second: file path, and then put them both
together as a string to the clipboard so I can paste it to the database
field.

Or, as an alternative, is there a way to straight into the directory
(using explorer) and get it from there quickly?  I don't want to have to
do a bunch of clicking and copying and pasting functions by hand.

TIA.

Phil.