阅读背景:

将当前时间作为YYYY-MM-DD-HH-MM-SS字符串获取

来源:互联网 

I'm trying to get the current time as a "YYYY-MM-DD-HH-MM-SS" formatted string in an elegant way. I can take the current time in ISO format from Boost's "Date Time" library, but it has other delimiting strings which won't work for me (I'm using this in a filename). Of course I can just replace the delimiting strings, but have a feeling that there's a nicer way to do this with date-time's formatting options. Is there such a way, and if so, how can I use it?I'm trying to get the current time as a "YYYY-M




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: