NO

Author Topic: Retrieving local time information with C run-time functions  (Read 1197 times)

Offline Vortex

  • Member
  • *
  • Posts: 477
    • http://www.vortex.masmcode.com
Retrieving local time information with C run-time functions
« on: October 27, 2013, 10:32:40 AM »
Here is a quick example :

Code: [Select]
include     LocalTimeCRT.inc

.data

format1     db 'Local time and date: %H:%M:%S %d-%m-%Y',0
format2     db 13,10,'Local time and date: %s',0

.data?

rawtime     dd ?
tminfo      dd ?
buffer      db 128 dup(?)

.code

start:

    invoke  time,ADDR rawtime
    invoke  localtime,ADDR rawtime
    mov     tminfo,eax

    invoke  strftime,ADDR buffer,128,ADDR format1,eax
    invoke  puts,ADDR buffer

    invoke  asctime,tminfo
    invoke  printf,ADDR format2,eax

    invoke  ExitProcess,0

END start
Code it... That's all...