65 questions
9
votes
7
answers
1k
views
Given a whole hour of the day, how to find the next whole hour?
I need to iterate through the whole hours of an interval of a particular day. So given the time at one whole hour on the day in question, say, 01:00, how do I find the next whole hour? The next whole ...
2
votes
1
answer
404
views
DateFormat.parse fails to parse dates/times that look fine
I'm getting the issue when converting string to TimeOfDay. It was working before but now I am getting the issue.
try {
final format = DateFormat.jm(); //"6:00 AM"
TimeOfDay day = ...
-1
votes
1
answer
251
views
how to format 24 hours format timeofday into 12 hours format flutter
when user using 24 hours format, I have pick time with showTimepicker have set
alwaysUse24HourFormat:false and when selecting time displays in 12 hour format but
selected timeofday is 24 hours format ...
0
votes
1
answer
1k
views
Get period between two times
I have two string time. How can I get a duration of period between theese two time?
I try to use DateTimeFormatter, but it doesn't work.
val startTime = LocalDate.parse("19:30", ...
0
votes
1
answer
475
views
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 &...
1
vote
4
answers
453
views
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.
...
1
vote
2
answers
100
views
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 ...
1
vote
2
answers
118
views
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;
...
1
vote
0
answers
133
views
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 = ...
1
vote
2
answers
321
views
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 ...
-1
votes
1
answer
543
views
How to import a CSV with an hour/minute string as a timestamp to panda dataset
I need to import a CSV to a panda dataset.
The CSV has columns with just a time of the day, an example is a columns with "16:45" at a minutes level, another column has "21:03:39" ...
1
vote
0
answers
197
views
_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 ...
0
votes
0
answers
201
views
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) {
...
-1
votes
1
answer
107
views
Convert any time zone to another (Java)
String time ="6:30"
How can I convert it to CST time zone?
If a user enters any time, it should convert into CST.
3
votes
1
answer
4k
views
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<void> ausgabe(BuildContext context) ...
0
votes
3
answers
2k
views
flutter) how can I convert String to Time? [duplicate]
Hi i have an array contains
List<dynamic> 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 ...
1
vote
0
answers
485
views
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 (...
4
votes
2
answers
4k
views
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....
0
votes
1
answer
70
views
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 ...
-1
votes
2
answers
154
views
How to customize the HH:mm format in Java [duplicate]
I am using HH:mm format to print the hour and minute in java. It will give the time in format
05:12, 00:04. But my requirement is to get with single digit hours:
05:12 => 5:12
00:04 => 0:04
10:...
0
votes
1
answer
178
views
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(...
0
votes
1
answer
746
views
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....
0
votes
2
answers
183
views
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 ...
-1
votes
5
answers
742
views
How to take Time Input in a line in Java? [closed]
The problem is for Java
I want to take time input as follows
12:00 AM 11:42 PM
There will be a sequence of such inputs up to N lines.
Here two different Time Inputs are given
1)12:00 AM
2)11:42 PM
...
0
votes
2
answers
41
views
How to just show the time not the time AND date? [duplicate]
<html>
<p id="time"></p>
<script>
var theDate = new Date(Date.parse(
'06/14/2020 9:41:48 PM UTC'));
document.getElementById("time&...
-1
votes
1
answer
708
views
Java function algorithm to add minutes to time [closed]
I'm writing a function that adds minutes to a time string - without using any libraries for Time. The function takes two arguments -
The first, a "time" ([H]H:MM AM|PM) String, in the ...
0
votes
2
answers
341
views
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" : ...
0
votes
1
answer
81
views
Math.min Military Time vs Base 8 [duplicate]
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 ...
0
votes
1
answer
1k
views
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 ...
-1
votes
3
answers
3k
views
convert time variable to hh:mm format in java
I'm a beginner in java and I with my code below I can generate a random time in "hh:mm:ss" format . I have no idea how to tweak my code to display time in "hh:mm" format as I am ...
0
votes
3
answers
1k
views
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&...
-2
votes
2
answers
472
views
What is the algorithm represented in Java to convert an 12 hour am/pm meridiem format hour to 24 hour format?
I needed to convert only the hour part of 12 hour time string to 24 hour format. I'm not interested in other than hour parts of a date string. SimpleDateFormatter is notoriously buggy and I in fact I'...
1
vote
3
answers
1k
views
How Do I Force A Specific Date Value into a Timestamp? [closed]
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 ...
0
votes
2
answers
2k
views
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 ...
-1
votes
3
answers
2k
views
How to get end time as float in Android
I had a String time format like 08:25 now how can I convert to float time value
String guestclosetime = getCurrentTime();
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
...
0
votes
0
answers
219
views
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 ...
0
votes
1
answer
531
views
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?
1
vote
2
answers
7k
views
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 ...
0
votes
0
answers
25
views
Best way to access the hour portion of a time string? (Java) [duplicate]
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 ...
0
votes
1
answer
62
views
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, ...
0
votes
2
answers
4k
views
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:...
2
votes
3
answers
860
views
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 ...
2
votes
2
answers
376
views
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 ...
1
vote
1
answer
113
views
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 ...
21
votes
9
answers
40k
views
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:...
40
votes
11
answers
35k
views
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 ...
0
votes
0
answers
50
views
Why DateTime.Now.TimeOfDay does not work as manual time setting?
I need to send the time of day to the API but TimeOfDay does not result right response (API returns null). If I set the time manually (commented in code) its working fine. Debug watch shows similar ...
1
vote
1
answer
2k
views
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 ...
0
votes
1
answer
2k
views
Error: Type mismatch. Value [00,00,00] does not match type timeofday
I want to create a google line chart from MySQL data which is in json form. JSON data is in this format:
{
"result": [
{
"Date": "Dec 17,2017",
"start_time": "22,...
2
votes
2
answers
399
views
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")
...