Questions tagged [timeofday]

Timeofday has two uses. It is one of the column types of a `DataTable` of the Google chart tools, and a property of DateTime in .NET 4.6 and 4.5 Use this tag for questions related to `timeofday`.

timeofday is used in Google Charts and .NET

Google Chart

Google Chart is a JavaScript Data presentation API. Internally, it stores data in (mutable) DataTables and/or (immutable) DataViews which is then passed into a chart.

They have different column types, including timeofday, which is initialized with an

Array of three numbers and an optional fourth, representing hour (0 indicates midnight), minute, second, and optional millisecond.

.NET

A DateTime object has the TimeOfDay property which returns a TimeSpan with the current time.

Use this tag for questions about timeofday.

63 questions
0
votes
1 answer

SimpleDateFormat does not parse correctly

String current = "07:00:00.160" DateFormat df2 = new SimpleDateFormat("HH:mm:ss.SSS"); DateList.add(df2.parse(current)); Returns [Thu Jan 01 07:00:00 GMT 1970] I have tried this as well Date currentdate; currentdate =…
0
votes
1 answer

How can I get AM or Pm at the end using TimeofDay and how can I add some text on that if it is null?

I want to add AM or PM at the end of time and for that I have tried doing like DateFormat('hh:mm a') it add AM or PM but then it picks a wrong time. How to fix this? Pls help me:- Future selectTimeEnd() async { final TimeOfDay picked = await…
GAGAN SINGH
  • 261
  • 2
  • 17
0
votes
1 answer

How to convert a time that is input in h:mm format to hh:mm format?

From a time input in format 5:00 to 05:00! in arr[1] there is "5:00" <--string format DateTimeFormatter time=DateTimeFormatter.ofPattern("HH:mm"); LocalTime arr1 = LocalTime.parse((CharSequence) time.parse(arr[1]));
0
votes
2 answers

Measuring Time-span from startpoint till current time, end of day, or endpoint

I'd like to write two methods which both rely on the information on how much time is left in the day (how many seconds there are left till the end of the day, as well as how much percent of the day already have passed). Different days have a…
0
votes
2 answers

How to just show the time not the time AND date?

0
votes
2 answers

Compare Date and Time range with Java

I have this input: { "MONDAY" : "02:39:00" } Which is a DAY and time that needs to compared to "availability" : { "SUNDAY" : { "from" : "00:00", "to" : "10:00" }, "MONDAY" : { "from" : "00:00", "to" :…
Fireburn
  • 981
  • 6
  • 20
0
votes
1 answer

Math.min Military Time vs Base 8

I'm making a program designed to get the elapsed time via military time and this is what I got so far: public class TimeInterval { private int firstTime; private int secondTime; public TimeInterval(int _first,int _second) { if…
Nebulor
  • 23
  • 2
0
votes
1 answer

Detecting work shift based on DateTime.Now and predefined hours comparison. c#

I want my program to reset statistics when new work shift starts. My shift hours are predefined as: Day shift 4:00 - 16:25 Mon-Thu (4:00 - 15:55 Fri-Sun) Eve shift 16:25 - 4:00 Mon-Thu (15:55 - 4:00 Fri-Sun) This is what I'm doing at the moment,…
W.Donald
  • 15
  • 1
  • 6
0
votes
3 answers

Addition of two times in JAVA

I want to make the addition of two times (java.sql.Time) without using any other library (java.date, LocalTime..), I get always the time under 1 hour. java.sql.Time Time heureDebut="09:00:00"; Time heureFin="00:15:00"; long heureDebuts =…
Mohamed Drira
  • 52
  • 1
  • 7
0
votes
2 answers

Flutter - Convert minutes to TimeOfDay

Currently I get a number from the BE that states like 750 minutes (int) and should represent the time of day. 750 minutes = 12.5 hours and so the UI should display 12:30 1080 minutes = 18 hours and so the UI should display 18:00 But I can't seem…
Dennis Anderson
  • 1,348
  • 2
  • 14
  • 33
0
votes
0 answers

Flutter - TimeOfDay to Firestore timestamp then into DateTime?

I have two fields of type TimeOfDay in a model class, which is called startTime and endTime, how do i store this type into a firestore field, as a Timestamp somehow? What i want to achieve is to pick a time like start: 12:00 , end: 13:00 from a…
Fluzzy
  • 81
  • 2
  • 8
0
votes
1 answer

Find difference between to times in TimeOfDay class like (10:50 - 08:00 = 02:50 )

I should have two times, one is the current time and the other I get it from time picker as shown below. How can I get the difference between them?
Nader Salah
  • 93
  • 1
  • 9
0
votes
0 answers

Best way to access the hour portion of a time string? (Java)

Essentially I'm going to be reading in a time string from the user in the format "HH:MM:SS" in 24hr format. I want to be able to say if HH > 12, then assign a variable "PM" and if HH < 12, then assign a variable "AM". Is splitting the string and…
fuzzdelay
  • 47
  • 6
0
votes
1 answer

Java String.format question for Time format

I was working on a HackerRank question where I turn time in 12 hour format (hour:min:sec am/pm) into 24 hour format (hour:min:sec) (eg hh:mm:ss) . I got everything done, with 3 int variables for hour, min, sec respectively and I want to turn them…
0
votes
2 answers

Time difference in AM/PM in Java

I am trying to calculate the time difference in java by input time format in 12 hours it works well when i input start time 11:58:10 pm and end time 12:02:15 am. But as i enter 12:00:00 am and 12:00:00 pm it give difference 0 minutes. don't know…
Azeem Hafeez
  • 250
  • 4
  • 14