3 ms·
If date formatting is a bottleneck for me (it is surprisingly often, because it's very slow in some languages) I typically just run it through the command-line
by mjn 13y ago
If date formatting is a bottleneck for me (it is surprisingly often, because it's very slow in some languages) I typically just run it through the command-line program 'convdate' [1] from crush-tools, which is more or less just a wrapper around strptime+strftime.
[1] https://code.google.com/p/crush-tools/wiki/ConvdateUserDocs https://code.google.com/p/crush-tools/wiki/ConvdateUserDocs
- justincormack 13y agoIf it is a bottleneck shelling out is not a great solution...
- pestaa 13y agoShelling out for each piece of data is indeed not great. Shelling out for batch-processing loads of data is on the other hand great.
- mjn 13y agoYes, and that's the workload convdate is intended for: it batch-converts an entire column of a tab-delimited file. The larger crush-tools suite is intended for unix-style batch processing of tabular data, but fills in some functionality that the classic set of POSIX tools (cut, sort, paste, join, etc.) didn't cover.
- deleted 13y ago[deleted]