Raised This Month: $32 Target: $400
 8% 

FormatTime error only on Windows


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fluffys
Member
Join Date: Jun 2015
Old 11-28-2017 , 16:37   FormatTime error only on Windows
Reply With Quote #1

Anyone know why I get this error only on windows? [SM] Exception reported: Invalid time format or buffer too small
Code:
// Format Joined Time
char szTime[128];
FormatTime(szTime, sizeof(szTime), "%d %h %Y", joinUnix);
joinUnix is a unix time stamp fetched from a database.

This works fine on Linux so I'm not really sure what the issue is.

Solved: turns out %h is invalid on Windows, use %b instead, does the same thing.

Last edited by fluffys; 11-28-2017 at 16:57. Reason: Solved
fluffys is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-28-2017 , 16:56   Re: FormatTime error only on Windows
Reply With Quote #2

Maybe szTime isnt enough large?
Facksy is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-29-2017 , 14:55   Re: FormatTime error only on Windows
Reply With Quote #3

Maybe you are not checking your db results properly.

Try printing the timestamp without a time format and see if you get your expected result.
__________________
Neuro Toxin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode