Reputation: 1187
I am trying to save a file into a directory of files based on the current date and time. I am trying to get the format of the following:
Upvotes: 2
Views: 600
Reputation: 62975
boost.date_time can do arbitrary formatting, to a higher a degree of precision than the standard functions are typically capable of. Specifically, see Date Time Input/Output Format Flags.
Upvotes: 0
Reputation: 5823
It depends on the format you have the time in right now. I'm a big fan of sprintf()
, and since I mostly deal with big piles of seconds, milliseconds, or nanoseconds, I do a lot of modulus arithmetic to get what I want.
Upvotes: 1