4 ms·
Show HN: An easier way to create and parse Unix Timestamps
- shubhamjain 10y agoJust for the background about why I made this when gazillions of such websites exist already? Simply because none of the existing ones did what I wanted — or did it effectively. It was beyond aggravating to parse the timestamp and then, account for offset hours according to the timezone. Additionally, all of them had multiple text inputs which is a terrible way to enter dates, or modify them. This is a trivial solution to a trivial problem, but it matters because none of the existing solutions were good enough.
- dozzie 10y agoAnd what was wrong with GNU date? $ date Fri Dec 16 11:12:17 CET 2016 $ date +%s 1481883140 $ date -d @1234567890 Sat Feb 14 00:31:30 CET 2009 $ date -d 'Sat Feb 14 00:31:30 UTC 2009' Sat Feb 14 01:31:30 CET 2009 $ date +%s -d 'Sat Feb 14 00:31:30 CET 2009' 1234567890 $ date +%s -d 'Sat Feb 14 00:31:30 UTC 2009' 1234571490
- stephenr 10y agoAll the cool kids know the best way to do basic computing tasks is to enter some shit in a webpage. We are seriously approaching "println as a service"
- shubhamjain 10y agoThere are significant problems with "data %whatever" approach that makes the "cool web app" a superior solution. It's the same reason why I — and many others — find it convenient to Google "500 pounds in Kgs" in place of GNU Units. Faster, intuitive and fits into my web-development workflow. How would you go about generating timestamp for a particular date? I guess there isn't any alternative to typing the whole string ( using previous output would save that hassle but why should I have two steps when one is better)? If I have to parse a timestamp for a particular timezone how would I go about it? I am sure there is a nifty option for offset-ing hours but I don't want to hunt down the flag for it. It's entirely possible to hack _.bashrc_, add some fancy aliases to make the terminal work better but I — and many others — don't consider it worth the arduous effort to create something that would still need terminal window, plenty of keystrokes against what is point-and-click.
- stephenr 10y ago> There are significant problems with "data %whatever" approach that makes the "cool web app" a superior solution. the GNU date command is one of many options that honestly should be quicker for most developers. > It's the same reason why I — and many others — find it convenient to Google "500 pounds in Kgs" in place of GNU Units. Faster, intuitive and fits into my web-development workflow. I didn't specifically recommend the GNU tool, (and I wouldn't actually recommend that one as the first option anyway), the point was more "whats wrong with a tool you already have on your workstation". For your example of pounds to kg, Spotlight gives me an answer quicker than any webpage will load, doesn't rely on an internet connection, doesn't show me any ads, nor does it use this information to create a profile that says I might want to either a) buy a calculator or b) go to a BBW dating site. Back to the dates: Every computer language in common use and most of the obscure ones handle dates and times. If you're writing code and can't fire up a REPL or use a one-liner to convert a date to timestamp or the reverse, I'd suggest you don't really know that language. > How would you go about generating timestamp for a particular date? I guess there isn't any alternative to typing the whole string...<snip> plenty of keystrokes against what is point-and-click I'm not even sure what you're suggesting here... oh. I see. I refer you back to the first part of this reply then.
- acemarke 10y agoLooks nifty. Would be nice if it handled millisecond timestamps too.
- kevinyun 10y agoThis is awesome. Best timestamp converter tool I've come across, and I've been using other websites that we're confusing but we're the top-ranked tools. Bookmarked for future usage. Nice job OP!