Raised This Month: $51 Target: $400
 12% 

Time formats available to windows?


Post New Thread Reply   
 
Thread Tools Display Modes
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 02-19-2014 , 17:48   Re: Time formats available to windows?
Reply With Quote #11

Quote:
Originally Posted by ThatOneGuy View Post
Not sure what youre referring to there...
I was referring to this string: "%s/%s "%s"

Three quotes, which would have produced a compile error. Your slash in the filename could be you writing a date like 11/27 or it may have been intentional and you wanted the month as [part of] the folder name. Anyway, moving on.
__________________

Last edited by 11530; 02-19-2014 at 17:48.
11530 is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 02-19-2014 , 18:38   Re: Time formats available to windows?
Reply With Quote #12

One more question...

If I build a path on globally with a time stamp in it, I'm guessing it will make the path, but its not being told to update the time stamp in the path, so unless the plugin/server restarts, would it forever use the time stamp it generated when it the plugin originally loaded? (does that make sense?)

e.g.

Code:
new String:sMainPath[PLATFORM_MAX_PATH];
FormatTime(sMainPath, sizeof(sMainPath), "pt_%m-%d.log"); 
BuildPath(Path_SM, sMainPath, sizeof(sMainPath), "logs/blah/%s", sMainPath);
If the above was built globally, would it retain the original date even after the day changes?

If so, can I fix that by putting this in OnMapStart() ? (thus remaking the path each map change, and ensuring the path is up to date (no pun intended)

Code:
FormatTime(sMainPath, sizeof(sMainPath), "pt_%m-%d.log"); 
BuildPath(Path_SM, sMainPath, sizeof(sMainPath), "logs/blah/%s", sMainPath);
Or maybe just this?

Code:
FormatTime(sMainPath, sizeof(sMainPath), "pt_%m-%d.log");
Just a thought....

Last edited by ThatOneGuy; 02-19-2014 at 18:38.
ThatOneGuy is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 02-19-2014 , 19:15   Re: Time formats available to windows?
Reply With Quote #13

You wouldn't need to BuildPath every time (since SourceMod's location won't change directory), but since strings don't change automatically, you'd have to reformat the string into a new date every time you want to use it.
__________________
11530 is offline
Reply



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 13:06.


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