Questions tagged [localtime]

Calendar time expressed relative to the user's local timezone.

Calendar time expressed relative to the user's local timezone.

461 questions
2
votes
3 answers

Java int formating?

I want the user to input hours and minutes for a Local.Time from 00 to 23 and from 00 to 59, I scanned this as an int. It works but for values from 00 to 09 the int ignores the 0 and places then as a 0,1,2...9 instead of 00,01,02,03...09; this…
2
votes
2 answers

How to specify time after daylight saveing time shift in Java

Using the following code: class Test { public static void main(String [] args) { LocalDate date = LocalDate.of(2018, 11, 4); LocalTime time = LocalTime.of(1, 59); ZonedDateTime dt = ZonedDateTime.of(date, time,…
2
votes
1 answer

can I do nested calls for system functions loaded by LD_PRELOAD

Hi I am trying to override sscanf() which gets called from localtime(), But its not calling sscanf() of my library loaded rather its calling sscanf() of glibc. Is there something I am missing? Files content mentioned…
Ami
  • 233
  • 2
  • 9
2
votes
5 answers

Parse to LocalTime pattern mm:ss.S

How can parse LocalTime from String e.g. "10:38.0" in mm:ss.S format? I struggle to change the format. public static LocalTime parseTime(String time) { return localTime = LocalTime.parse(time, DateTimeFormatter.ofPattern("mm:ss.S")); …
Elisiejus
  • 43
  • 1
  • 3
2
votes
1 answer

How to check if two LocalTimes are in the same day?

From my UI I'm passing two LocalTime values; from time and to time. Both times are LocalTime HH:mm formatted. Now I need to check whether these times are in the same day. For an example if someone passes fromTime - 18:00 and toTime - 10:00, I need…
neo mal
  • 67
  • 1
  • 8
2
votes
1 answer

Persisting java.time.LocalTime into oracle with Types.TIME loses fractional seconds precision

I have a behavior with Oracle which I'm not sure is intended or not. I am playing with the various types of the java date/time API, using them at the JDBC level. I am trying to persist an instance of java.time.LocalTime into an oracle database. At…
jmaniquet
  • 93
  • 4
2
votes
3 answers

Time inconsistencies in Python

I am facing some problems in a cross platform program: when I open a python shell in Linux and in Windows, I don't get the same time from the Epoch. In Linux, I tried to do dpkg-reconfigure tzdata. Currently, in linux I get that avec the…
Mr_Kaz
  • 73
  • 1
  • 9
2
votes
3 answers

Get all milliseconds from LocalTime Java

I need to know how to get LocalTime to milliseconds LocalTime lunchTime = LocalTime.parse("01:00:00", DateTimeFormatter.ISO_TIME); If i am going to execute lunchTime.getMinute() i only get 0 and lunchTime.getHour() i only get 1 as…
anduplats
  • 885
  • 2
  • 14
  • 24
2
votes
1 answer

java.time.LocalDateTime, multiple time lines?

Here in Washington DC, on November 3rd 2019 at 2:00 am the clock was "moved back" to 1:00 am. This means the local time was like this: === Nov 2nd ===:=== Nov 3rd =========== : 9 10 11 12 1 …
The Impaler
  • 45,731
  • 9
  • 39
  • 76
2
votes
1 answer

Convert from LocalTime to TimeSpan

I am using NodaTime and Entity Framework Core in my application. I am using AutoMapper to convert from my models (which use LocalTime) to my entities (which use Timespan which is mapped to Time in Sql Server). I am doing it this way to avoid the…
2
votes
1 answer

How to display (the hours of) a local time in a spinner in JavaFx

How do I set the value of SpinnerValueFactory valueFactory = new SpinnerValueFactory() in a spinner? Attempting to set and display the value in the spinner editor with hrsSpinner.getValueFactory().setValue(valueFactory); , Java…
AverageJoe
  • 27
  • 7
2
votes
0 answers

How to convert a UTC datetime object to a localtime tuple?

I have a datetime object t which is in UTC time but attached with Alaska timezone offset(-08:00): t -> datetime.datetime(2019, 3, 23, 15, 49, 34, tzinfo=tzfile('/usr/share/zoneinfo/America/Anchorage')) I try to convert t to a datetime tuple in…
2
votes
1 answer

MinGW localtime_r works in one time zone, fails in another

I have the following file test.c: #define _POSIX_THREAD_SAFE_FUNCTIONS #include #include #include #include #include int main(int argc,char**argv) { struct tm t1, t2, t3; time_t…
Simon Kissane
  • 4,373
  • 3
  • 34
  • 59
2
votes
4 answers

JavaScript Local Time printing

Being a beginner, I'm facing some problems. Even I can't find any solution by googling it. Problem: In my language (Bengali), the entire daytime has five strings ( Sokal, Dupur, Bikal, Sondha, Raat) instead of the international two strings(Am, Pm)…
KB Tonmoy
  • 37
  • 8
2
votes
1 answer

Error parsing datetime, DateTimeParseException with valid timestamp

I'm trying to parse a timestamp object from sql and am having problems, heres what I have: DateTimeFormatter dateDTF = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT); String start = c.getStartTime().getValue(); //Start: 2018-12-01…
Joe
  • 269
  • 3
  • 13