All Questions

675
votes
13answers
1344293 views

Java string to date conversion

Can somebody recommend the best way to convert a string in the format 'January 2, 2010' to a date in java? Ultimately, I want to break out the month, the day, and the year as integers so that I can u...
334
votes
43answers
492160 views

Calculating the difference between two Java date instances

I'm using Java's java.util.Date class in Scala and want to compare a Date object and the current time. I know I can calculate the delta by using getTime(): (new java.util.Date()).getTime() - oldDate....
1276
votes
34answers
129366 views

Calculate relative time in C#

Given a specific DateTime value, how do I display relative time, like: 2 hours ago 3 days ago a month ago
8
votes
1answers
4346 views

What are the "standard" timezone abbreviations?

I am storing time zone by offset-from-UTC for an application using this dropdown: <select id="timezone" name="timezone" > <option value="-12">[UTC - 12] Baker Island Time</option> &...
201
votes
12answers
388848 views

How to get time difference in minutes in PHP

How to calculate minute difference between two date-times in PHP?
834
votes
33answers
1030481 views

Get current time and date on Android

How can I get the current time and date in an Android app?
1250
votes
4answers
310098 views

What do 'real', 'user' and 'sys' mean in the output of time(1)?

$ time foo real 0m0.003s user 0m0.000s sys 0m0.004s $ What do 'real', 'user' and 'sys' mean in the output of time? Which one is meaningful when benchmarking my app?
217
votes
21answers
404318 views

How do you format date and time in Android?

How do you format correctly according to the device configuration a date and time when having year, month, day, hour and minute?
167
votes
17answers
236245 views

How do you display JavaScript datetime in 12 hour AM/PM format?

How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?
457
votes
23answers
447600 views

How to convert Milliseconds to "X mins, x seconds" in Java?

I want to record the time using System.currentTimeMillis() when a user begins something in my program. When he finishes, I will subtract the current System.currentTimeMillis() from the start variable,...

Previous Next