0
A
回答
0
一種方法可能是將字符串解析爲各種組件並使用它們填充tm結構。一旦你的結構充滿了數據,你可以使用C函數mktime將結構轉換爲time_t類型。
在Visual C++中可能有更多的理想方法來做到這一點,但在正常的C/C++中,這可能是我會這樣做的方式,直到找到更好的算法。
相關問題
- 1. 將字符串轉換爲time_t,然後將time_t轉換回字符串
- 2. 將字符串從__DATE__轉換爲time_t
- 3. 如何在C++中將ISO 8601字符串轉換爲time_t?
- 4. 如何將time_t類型轉換爲C++中的字符串?
- 5. C++將字符串轉換爲time_t問題
- 6. 將wxString轉換爲time_t
- 7. 將time_t轉換爲整數
- 8. 將毫秒轉換爲time_t
- 9. 將steady_clock :: time_point轉換爲time_t
- 10. 將time_t轉換爲int64_t
- 11. 將time_t轉換爲int
- 12. 日期/時間轉換:字符串表示形式到time_t
- 13. 使用從字符串轉換的time_t獲取時間差
- 14. C - time_t字符串表示
- 15. 將字符串轉換爲int,int轉換爲字符串
- 16. 字符串轉換爲字節轉換
- 17. 將字符串轉換爲字符串
- 18. 將字符串轉換爲字符串
- 19. 將字符串轉換爲字符串
- 20. 轉換數字字符串轉換爲字符串
- 21. 使用std :: get_time將時間字符串轉換爲std :: time_t:錯誤結果
- 22. 關於C中給定的格式轉換time_t表示爲一個字符串
- 23. 轉換一個字符串轉換爲字符串
- 24. 將轉換器映射字符串轉換爲字符串
- 25. 轉換time_t的蜱
- 26. 轉換列表轉換爲字符串
- 27. 的Node.js:XML轉換爲字符串轉換
- 28. SimpleDateFormat轉換爲字符串
- 29. 字符串轉換爲碳
- 30. SID轉換爲字符串
字符串的格式是什麼? – 2011-02-18 14:51:51