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
1
vote
0 answers

_pickedTime.format(context) not working in real device flutter(TimeOfDay to String)

I always get this error Trying to read from 08:43 at position 6 whenever am converting from TimeOfDay to String using _pickedTime.format(context). It throws the error on my real device but works perfectly on my emulator. How do I solve this error.…
Emeka Jide
  • 11
  • 2
1
vote
2 answers

Flutter/Dart TimeOfDay object returns TimeOfDay(15:00) instead of only the time

i want to print the Time that i initialized manually but if i print it then i only get this here. I/flutter (14375): TimeOfDay(15:00) Here is my Code Future ausgabe(BuildContext context) async { Map zeiten = {"Montag":…
Eren G
  • 43
  • 8
1
vote
0 answers

Error when converting String to DateTime: System.FormatException: String was not recognized as a valid DateTime

I am trying to compare two dates in C#. One is a sunset date and one is the current date. I am trying to determine whether it's after or before sunset. I have two dates like that: 2021-12-02 16:19 (Current Date) 05:55:50 PM (Sunset Date) I have…
1
vote
3 answers

How Do I Force A Specific Date Value into a Timestamp?

So I have a date value I had to convert to a timestamp in order to pass the value to a specific method. However, in order to finish the work, I've been told the value of the timestamp's date has to be set to 1900-01-01. So something like this …
Jack Parker
  • 547
  • 2
  • 9
  • 32
1
vote
2 answers

Add AM or PM when converting from 24 hour to 12 hour format in flutter

I have a time-picker that displays the current time the user selects. I am able to convert it from 24 hour to 12 hour format. But I want it to also display AM and PM, not just AM. Is there any way to show the time with AM and PM using the TimeOfDay…
Bashaar Shah
  • 35
  • 1
  • 3
1
vote
3 answers

Time without date

I get time with time zone (without date component) from a PostgreSQL server in json like this { "time": "03:00:00+01" }. How do I handle this in Android? Is there any structure which can hold just time without date? Or converting it to the epoch…
yaugenka
  • 2,602
  • 2
  • 22
  • 41
1
vote
1 answer

Google Visualization SteppedAreaChart with time as axis incorrectly aligned

I'm creating a SteppedArea chart in Google Visualization to display queue length at various times of the day. My problem is that the steps in the chart don't align with the associated times. They are always one data point out. In the example…
CitFar
  • 11
  • 2
1
vote
1 answer

flutter timeofday calculations

in my flutter app the user picks a time and I need to simply add some hours and minute to it to display the result. Is that easily possible? Unfortunately, there doesn't seem to be a function like TimeOfDay.add(). Any ideas?
tmaihoff
  • 2,867
  • 1
  • 18
  • 40
1
vote
4 answers

how to know am or pm in vb

im doing my activity dtr system and i want to know how to determine whether it am or pm? 7am - 12:30 pm should go on AM, and 1pm - 5PM will go to pm. for example: if the time is 12:30 pm its still go to am and if its 12:31 pm it will go now to…
ken abaki
  • 97
  • 1
  • 9
1
vote
0 answers

Aggregate an array of Merchant store hours that overlap to produce a single range

I have a list of store hours from a merchant that could potentially overlap stored in AvailableHours model. The model has a start_time and an end_time stored as a TimeOfDay object (https://github.com/JackC/tod). I want to iterate through the list…
Huy
  • 10,806
  • 13
  • 55
  • 99
1
vote
1 answer

Add class depending on time of day not working

Hi I found some code here and have tweaked it to add a class to depending on the time of day but its not working, i saw it working for a split second today but no class is being added atm and i don't know why.
user1338176
  • 105
  • 13
0
votes
1 answer

ggplot scale for time of date only, when using POSIXct datetimes

In ggplot2, I have a question about appropriate scales for making POSIXct datetimes into time-of-day in an axis. Consider: library(tidyverse) library(lubridate) library(hms) library(patchwork) test <- tibble( dates = c(ymd_hms("2022-01-01…
evidently
  • 43
  • 4
0
votes
2 answers

How to sort TimeOfDay list from earliest to latest time?

I need to display a schedule for users that displays times from earliest to latest time. I have a TimeOfDay list containing times and need it to be sorted from earliest to latest time. I made a function for it, but keep getting _TypeError (type…
nsa41620
  • 13
  • 4
0
votes
0 answers

online java compilers gives different results than eclipse and intelliJ

The code simply extract the time portion of two timestamps and sub them from each other to get the duration import java.util.Calendar; public class Test { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); …
0
votes
3 answers

flutter) how can I convert String to Time?

Hi i have an array contains List am = ['09:00', '09:30', '10:00', '10:30', '11:00', '11:30']; and if they are selected String time = '09:00' how can I change time to the DateTime value or TimeOfDay
Noah_J.C_Lee
  • 163
  • 2
  • 11