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
34
votes
10 answers

Dart/Flutter How to compare two TimeOfDay times?

TimeOfDay documentation has no comparison operator and primitive comparison does not work. My only solution that I can thinking of right now is to convert TimeOfDay to DateTime and use DateTime's difference method. Does anyone have a better…
Jesse
  • 2,690
  • 9
  • 15
  • 28
21
votes
9 answers

Flutter Format Time of Day from time picker

I am trying to format the selected time from time-picker in my flutter app. I don't know why but this is proving to be more difficult than it should be. The end result I am trying to achieve is hour:minuets or 5:00pm. This will display in a box…
theSimm
  • 450
  • 4
  • 9
  • 16
11
votes
4 answers

Google Charts API - Column patterns and "TimeOfDay" data type

I'm working with the Google Charts API to create a graph of a student's test-taking performance. On the X axis, the graph shows the days of the week. On the Y axis, the graph shows how long the student spent taking the exam. (The goal is for…
Ben Gotow
  • 14,805
  • 3
  • 42
  • 47
7
votes
6 answers

How can I compare two times in VB.net

I want to compare two times in VB.net: I have 1:42:21 PM and I want it to compare with TimeOfDay in VB.net how can I do that?
Web Worm
  • 2,080
  • 12
  • 40
  • 65
3
votes
2 answers

How to change time format in Java - "am/pm" vs. "AM/PM"

Tests created previously use DateTimeFormatter.ofPattern("ha"); and returns "10AM" (for '2017-04-09T10:00-06:00[US/Mountain]'). Under my MacOs and Java ['openjdk version "11.0.12"'] I got "10am" "10AM" != "10am" In specification I see "ha" should…
THM
  • 579
  • 6
  • 25
2
votes
2 answers

Any way to filter all files during specify timing?

I have nearly 500k of CCTV files in different folder map to X drive and I need to delete all of them with specific timing such as from 12midnight to 6 am only but keeping the remaining regardless of date. how can I do that? I tried using for files…
iSpoon
  • 27
  • 6
2
votes
2 answers

Check if timeofday is in a specified range

Dim time As String = TimeOfDay.ToString("tt") Dim time2 As Integer = TimeOfDay.ToString("hh:mm:ss") If time = ("du.") Then timehre = (time2 + 12) Debug.WriteLine("munkaidoben") Else Debug.Write("munkaidoben =…
2
votes
1 answer

How may I explicitly define the datatype of a Google Charts DataTable column after it has been created?

I am using jquery-csv toArrays function to populate a google visualization DataTable like this: function drawChart() { // Load the CSV file into a string $.get("Book1.csv", function(csvString) { // transform the CSV string into a…
tohox
  • 105
  • 5
2
votes
1 answer

Populating timetoday columns with vars

Why does this work: table.setCell(0,0,[18,12,31]); and this doesn't strTime="18:12:31"; time = strTime.split(":"); table.setCell(0,0,time); the column has been defined by table.addColumn('timeofday','Time');
Herman
  • 21
  • 1
2
votes
1 answer

c# TimeOfDay not between 2 timespans

Having today's date for example: DateTime.Now And 2 TimeSpan that represents two periods of time DateTime mydate = DateTime.Now; TimeSpan start = TimeSpan.Parse("14:00:00"); TimeSpan end = TimeSpan.Parse("15:00:00"); // TO DO: How to check…
user2818430
  • 5,853
  • 21
  • 82
  • 148
1
vote
1 answer

Want to change DateTimePicker.Value.TimeOfDay, but it is read only

I am trying to check an entered time in a DateTimePicker control and correct it to the closest acceptable value in C# if (Summer1.Value.TimeOfDay > Summer2.Value.TimeOfDay) Summer1.Value.TimeOfDay = Summer2.Value.TimeOfDay; It gives…
1
vote
4 answers

Java regex to fetch HH:MM:SS from a string

String time = "Thu Dec 22 01:12:22 UTC 2022"; How to fetch the HH:MM:SS (01:12:22) here using java regex . So the output should be 01:12:22 I am using the below code but its not working. System.out.println("Hello, World!"); String time =…
Zoso619
  • 163
  • 1
  • 3
  • 15
1
vote
2 answers

How to put the selected hourOfDay and minute into one variable to make comparison with current time?

I'm trying to make a if-else statement that if user put time which have past, it will alert the user that the time has past. And I also unable to set the timedialogpicker to the current time when the user open it. Thanks in advance. The…
1
vote
2 answers

Java - How do i find out that a string is in the correct format using pattern matching

My string value; 09:00-10:00,12:00-14:30,16:00-18:00 (this string repeats time intervals n times like this) and I want to find out that a string is in the correct format using pattern matching; Pattern.matches("", stringValue); is it…
1
vote
0 answers

Android DateTimeFormatter - Time Conversion not working on samsung devices

I was working on Time conversion from One Locale to another (US to Swedish) in android using Java. It is working well on all the devices except Samsung devices. DateTimeFormatter parser = DateTimeFormatter.ofPattern("hh:mm a",…
1
2 3 4 5