Winapi: getlocaltime, setlocaltime, and setsystemtime-Get and set the system time

Source: Internet
Author: User
// Declare getlocaltime (VAR lpsystemtime: tsystemtime {tsystemtime structure}); {No return value} // set the local time setlocaltime (const lpsystemtime: tsystemtime {tsystemtime structure}): bool; // setsystemtime is set to the Greenwich Mean Time setsystemtime (const lpsystemtime: tsystemtime {tsystemtime structure}): bool; // tsystemtime is the definition of the _ systemtime structure: _ systemtime = record wyear: word; {year} wmonth: word; {month} wdayofweek: word; {week} wday: word; {day} whour: word; {hour} wminute: word; {minute} wsecond: word; {second} wmilliseconds: word; {millisecond} end;
  
   
 // Example: Procedure tform1.formcreate (Sender: tobject); var T: tsystemtime; begin getsystemtime (t); memo1.clear; with memo1.lines do begin add (format ('year: % d ', [T. wyear]); add (format ('month: % d', [T. wmonth]); add (format ('Week: % d', [T. wdayofweek]); add (format ('day: % d', [T. wday]); add (format ('hour: % d', [T. whour]); add (format ('minute: % d', [T. wminute]); add (format ('Seconds: % d', [T. wsecond]); add (format ('millisecond: % d', [T. wmilliseconds]); end;
  
   
 //:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.