Results 1 to 6 of 6

Thread: [RESOLVED] [2.0] Set Date Time

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Resolved [RESOLVED] [2.0] Set Date Time

    Hi guys good day. As of now I have no idea on how to achieve this, set the date time in my local machine. Any one here tried this one? If so a sample code or a link would be a good input.


    Thanks in advance guys.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Set Date Time

    Give me an M, give me an S, give me a D, give me an N.

    http://msdn2.microsoft.com/en-us/library/ms172517.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: [2.0] Set Date Time

    Quote Originally Posted by jmcilhinney
    Give me an M, give me an S, give me a D, give me an N.

    http://msdn2.microsoft.com/en-us/library/ms172517.aspx
    You've got a cute pompom's mate.


    btw thanks.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Set Date Time

    I just realised that that is for WinCE. It's all the same in big Windows except that the API functions are in Kernel32.dll
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Set Date Time

    Also, note that the SYSTEMTIME object you pass must represent a UTC time. If you want to specify a local time then create a DateTime object and specify the Kind as Local, then call ToUniversalTime on it to get the equivalent UTC time. You would then set the SYSTEMTIME fields from that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: [2.0] Set Date Time

    I did a deep search about this one and I found out WMI classes are perfect for this one and yeah it works. I just enable the priveleges of the managementobject.

    Thank you for the input JM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width