hey,
I need a 24 hr i.e 00:00 to 23:59 timepicker in javascript.
Precisely, the requirement is such that the database format are 24 hr timestamps. Hence I cant use am or pm time pickers..
Plz help guyzz..
hey,
I need a 24 hr i.e 00:00 to 23:59 timepicker in javascript.
Precisely, the requirement is such that the database format are 24 hr timestamps. Hence I cant use am or pm time pickers..
Plz help guyzz..
I'm not sure what you mean by "timepicker" but maybe you want something like this:
function getDate24(d) {
try { return d.getHours() + ':' + d.getMinutes(); }
catch(e) { return false; }
}
which returns a hh:mm string when fed with a javascript Date. If something other than a Date
is passed in, then false
will be returned, which you can test for and take appropriate alternative action. This approach will prevent generating a javascript error and consequential crash.
Sample call, for current local computer time, would be:
var timeStr24 = getDate24(new Date());
Airshow
Check out the Any+Time(TM) Datepicker/Timepicker AJAX Calendar Widget, it can format a date and/or time however you need it.
If you have problems or suggestions, just submit them via the contact page on that website.
Nice link.
Blacklister, please ignore my rubbish above. I now know what you mean by Timepicker. It's obvious when one has one's thinking head on.
Airshow
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.