Solved

Time

Posted on 2006-07-12
10
289 Views
Last Modified: 2008-02-01
Ok here it goes:

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



in F()
 Dim SysTime As SYSTEMTIME
   GetSystemTime SysTime


I get 20:00:00 instead of 16:00:00, so i do i get the computer time ? looks like this is givie global time.
0
Comment
Question by:TheSonics
10 Comments
 
LVL 10

Expert Comment

by:fostejo
ID: 17094798
TheSonics,

GetSystemTime return the time in Coordinated Universal Time (UTC) - if you need to return the current *Local* time, you'll need to use the GetLocalTime API instead (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getlocaltime.asp)

Have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/local_time.asp for more information or http://www.thescripts.com/forum/thread191443.html for an example of a script to show 'both' times.

cheers,
0
 
LVL 9

Accepted Solution

by:
justchat_1 earned 43 total points
ID: 17096537
why use an api call?-vb has a bult in local time function
0
 
LVL 4

Assisted Solution

by:jomacinc
jomacinc earned 41 total points
ID: 17096903
I agree with justchat_1

{SystemTime} = Time()
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 15

Assisted Solution

by:Ryan_R
Ryan_R earned 41 total points
ID: 17151751
just to make it easier like said above

myVariable = Time

will give you the current system time

while we're here you can also use

myVariable = Date
for the obvious result (system date given)
0
 
LVL 4

Expert Comment

by:jomacinc
ID: 17292175
IMO justchat_1 posted the correct answer and the rest of us just clarified it.
0
 
LVL 15

Expert Comment

by:Ryan_R
ID: 17292610
i agree, however it may be reasonable to conclude that a COMPLETE BEGINNER wouldn't really be able to apply the suggestion of justchat_1 without a vb6 example statement as you and I both clarified - maybe split between the two of you

Ryan R
0
 
LVL 15

Expert Comment

by:Ryan_R
ID: 17292622
oh and while we're all here why don't we go even more specific

you can also use the vbHour, vbMinute, and vbSecond functions to provide the individual results (although i belive the vbHour uses 24-hour format)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now