public class Time extends Object
| Constructor and Description |
|---|
Time() |
| Modifier and Type | Method and Description |
|---|---|
static String |
parseSecondsToTime(double seconds)
Parses seconds to this time format: hh:mm:ss {AM|PM}
|
static double |
parseTimeToSeconds(String timeString)
Parse time to seconds.
|
public static String parseSecondsToTime(double seconds)
seconds - secondspublic static double parseTimeToSeconds(String timeString)
If you add PM or AM to timeString, it considers english-time, otherwise not.
timeString can be 6AM, 06AM, 6 am, 6:01AM, 6:1 pM, 6:12:1 pm, 6:12:01 am, 06:12:01 Pm etc. - but not more precise than seconds.
example: 12 AM returns 12*3600. sec 6:30 AM --> 6*3600. + 30*60. 0:30:20 AM --> 30*3600. + 20. 6:00 PM --> 6*3600. + 12.*3600. 6:00:12 --> 6*3600. + 12.
Copyright © 2013–2019. All rights reserved.