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
1
vote
1 answer

adding a duration to a LocalTime

I'm trying to add 2 times like so: I have a LocalTime called from(da) and I want to make it so that "from" is the start parameter (inizio) with some minutes added (tariffa.getMinutiFranchigia(), that I'm getting from another class). How can I do…
chiagger
  • 63
  • 1
  • 8
1
vote
4 answers

How to use LocalTime correctly in a method?

I have to create a class CarFactory, which draws a car as per seasons (this one I think I got right) and also switches on lights of the given car from 20pm till 6am. Please igonore @Beans, it is just for testing purposes. My question is how the…
Veronique
  • 23
  • 7
1
vote
1 answer

Get LocalTime of a different Time zone c++

System is in UTC, Is there a way to get a local time of a specific timezone? Most windows api's return values based on system time. If there is any api where we could pass the timezone indication and get the localtime? Also, read different api's…
Sash
  • 45
  • 7
1
vote
1 answer

Query Local Time with ObjectBox

I have two questions, How do you save a LocalTime rage with ObjectBox, for example: class LocalTimeRage { LocalTime opens; LocalTime closes; } And 2. How can you query with ObjectBox a local time range, for example, query object that…
Fireburn
  • 981
  • 6
  • 20
1
vote
1 answer

Simple Alarm System using Interface Java

Okay so, I was given task to create basic alarm implementing interface. Here's what I've got so far. Here is my main method. import java.util.Scanner; import java.time.LocalTime; public class Monday extends Weekday{ private String time; …
1
vote
1 answer

How to properly initialize time with localtime in c++?

I am getting the beginning of Epoch, where I should get current time: date.hpp: #ifndef DATE_HPP #define DATE_HPP #include #include #include class Date { std::stringstream format; struct tm *date_tm; …
milanHrabos
  • 2,010
  • 3
  • 11
  • 45
1
vote
2 answers

localtime() reports incorrect hour and isdst flag

UPDATED CODE 11/06/20 localtime is reporting incorrect tm_hour (+1 hour) and tm_isdst (1). Notes: I am in the Eastern time zone. It is currently Nov 6 (not DST). Environment variable TZ is not set. The Control Panel (Date & Time) is set to…
DontPanic
  • 2,164
  • 5
  • 29
  • 56
1
vote
1 answer

From UTC to local time doesn't consider daylight saving swift

I am using this function to convert UTC time to my local time stamp. func UTCToLocal(date:String, timeZone: String) -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "H:mm:ss" dateFormatter.timeZone =…
khadeeja
  • 144
  • 2
  • 10
1
vote
1 answer

GMT to local time conversion ERROR with swift UIKIT

Does anyone have an answer to why I am getting -8 hours instead of -7 (my timezone) hours difference upon converting time from GMT to local i using the formula below: print("TIMEZONE IN HOURS: \(timeZone/3600)") let interval =…
AA Kanj
  • 13
  • 4
1
vote
1 answer

How get a local time with same time format on windows?

I have a c++ class code which return a local time: SYSTEMTIME sm; GetLocalTime( &sm ); but sm.wHour always returns an hour in 24 format, it doesn't concern my windows os time format settings!! (ie. use 24 or 12 time format). How can I get a local…
Bassam Najeeb
  • 607
  • 2
  • 7
  • 16
1
vote
0 answers

Confused about localtime in Glibc (daylight saving time)

I'm working a RTC and want to use glibc to get correct time. I am in Sydney and the DST time occurs at Oct first Sun 2am & Apr first Sun 2am. E.g. On 2020 Apr 5, 1:59:59 -> 2:00:00 -> 2:59:59 -> 2:00:00 -> 2:59:59 -> 3:00:00 I use functions :…
char990
  • 11
  • 1
1
vote
1 answer

How can Miller convert a local date and time to UTC?

How can Miller 5.6.2 convert a local date and time to UTC using an expression simpler than the following? $ printf "time1\n2019-06-13 05:54 PM\n" | mlr --csv put ' $time1=sec2gmt( localtime2sec( strftime( strptime($time1,…
Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
1
vote
0 answers

Variable doesn't spit out anything

Variables are not behaving as expected im trying to make a bat file that backs-up my minecraft world (windows 10 edition/uwp). @echo off cd.. TASKLIST /FI "IMAGENAME eq Minecraft.Windows.exe" 2>NUL | find /I /N "Minecraft.Windows.exe">NUL IF…
sane
  • 21
  • 1
  • 5
1
vote
1 answer

Modelica getTime not available

I am unable to access the Modelica.Utilities.System.getTime() function on Modelica. For some reason it does not exist in the MSL in Plug-in dependencies. Any idea how to import this?
1
vote
1 answer

NodaTime database json serialization

I'm saving list of schedules in my jsonb column in postgres database and I'm having problems with LocalDate NodaTime type. Here is my object that is being serialized (actually List is serialized and stored in database) public class…
zhuber
  • 5,364
  • 3
  • 30
  • 63