News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

CRT strftime problem

Started by jj2007, November 12, 2015, 09:45:56 PM

Previous topic - Next topic

jj2007

include \masm32\include\masm32rt.inc

.data?
buffer db 80 dup(?)
timeinfo SYSTEMTIME <>

.code
format$ db "Now it's %I:%M %p", 0
start:
  invoke crt_strftime, addr buffer, 80, addr format$, addr timeinfo
  print str$(eax), " bytes returned", 13, 10
  print LastError$(), 13, 10
  inkey offset buffer
  exit

end start


Works like a charm, except that the output is wrong. Same format$ in C works just fine...

Where is my error?

17 bytes returned
Operazione completata.

Now it's 12:00 AM

TWell


jj2007

 8)

Just found Erol's solution. It is simple a lil'bit more complicated :(