The MASM Forum

General => The Campus => Topic started by: jj2007 on November 12, 2015, 09:45:56 PM

Title: CRT strftime problem
Post by: jj2007 on November 12, 2015, 09:45:56 PM
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
Title: Re: CRT strftime problem
Post by: TWell on November 12, 2015, 10:23:00 PM
CANCELLED
Title: Re: CRT strftime problem
Post by: jj2007 on November 12, 2015, 10:49:11 PM
 8)

Just found Erol's solution (http://masm32.com/board/index.php?topic=2506.0). It is simple a lil'bit more complicated :(