B4i Question [B4X] DateTime.Date gets the year as short number 21 instead of 2021 - cklester (first post)    Mar 11, 2021   (1 reaction) I think you can set DateFormat.
DateTime.DateFormat = "yyyy.MM.dd"
DateTime.Now '2021.03.11
Then it should spit it out like you want.
In your case:
DateTime.DateFormat = "dd.MM.yyyy" B4A Question [SOLVED] Period not returning expected result. - Mahares (first post)    Jun 29, 2021   (1 reaction) When you start typing DateUtils.SetDate( you will see in the intellisense that it tells you the time will be 00:00:00
You were not comparing the 2 dates with respect to the same exact time slot of the day.
DateTime.Now means more than today. It means today plus the time you took the reading which B4A Question Comparing 2 date time values in b4A and displaying date in dd-Mon-yyyy hh:mm AMPM format - reg. - Mahares (first post)    Feb 22, 2022   (1 reaction) No. Those dates are a combination of date and time because your Dateformat is:DateTime.DateFormat = "dd-MM-yyyy HH:mm"
Look at the diffeence between these two below formats:
DateTime.DateFormat = "dd-MM-yyyy"
DateTime.TimeFormat = "HH:mm"
Log(DateTime.Date(DateTime.Now)) '21-02-2022
L B4A Question Time is not stable and not accurate as well !!! - emexes (first post)    Aug 12, 2024   (2 reactions) DateTime.DateFormat = "MM/dd/yyyy"
DateTime.timeformat = "HH:mm:ss"
LastCorrectDateTimeNow = DateTime.DateTimeParse("01/01/2024", "12:34:56")
Log(DateTime.Date(LastCorrectDateTimeNow) & " " & DateTime.Time(LastCorrectDateTimeNow))
AddTicksPerDay = -4000
ExampleTimer.Ini German Aktuelles Alter aus Datum berechnen - PaulMeuris (first post)    Apr 05, 2023 Lothar,
Die erste Linie solte da sein.
Also:
DateTime.DateFormat="dd.MM.yyyy"
Dim diff2 As Period = DateUtils.PeriodBetween(DateTime.DateParse("07.03.1961"),DateTime.DateParse("06.03.2023"))
Log(diff2.Years)
Wenn die erste Linie nicht da ist, bekommen Sie den Fehler. B4i Question Problem with DateTime - Semen Matusovskiy (first post)    Apr 04, 2021 You can use DateTime.DateTimeParse
Android's DateTime.TimeParse ("11:30") is equal DateTime.DateTimeParse (DateTime.Date (DateTime.Now), "11:30") B4A Question DateTime.SetTimeZone - LucaMs    Apr 18, 2017   (1 reaction) DateTime.DateFormat = CurrentDateFormat
' Resets the time zone offset.
DateTime.SetTimeZone(DeviceTimeZoneOffset)
Return Result
End Sub
Sub GetTimeZoneOffset As Int
Dim s, d As String
Dim l As Long
s = DateTime.DateFormat
DateTime.DateFormat = "MM/dd/yyyy HH:mm:ss"
l = Date B4A Question How to show time Hr:Min AM/PM - Andrew (Digitwell) (first post)    Dec 21, 2020 DateTime.Timeformat is a string so you can save it before the change and restore it afterwards.
eg.
private originaltimeformat as string = datetime.timeformat
DateTime.Timeformat ="hh:mm:ss a"
Log(DateTime.Time(l)) '02:00:00 PM
datetime.timeformat = originaltimeformat B4A Question Parse date crash - Mahares (first post)    Nov 01, 2021 No. It should be:
DateTime.DateFormat="EEE MM/dd/yyyy" B4i Question [SOLVED] Problem with NSTimeZone - Semen Matusovskiy (first post)    Apr 07, 2021 Keep date/time in UTC (similar DateTime.Now).
DateTime.Date / DateTime.Time convert to local time, which includes daylightSavingTimeOffset.
For example,
Log (DateTime.Date (DateTime.Now) & " " & DateTime.Time (DateTime.Now))
Log (DateTime.Date (DateTime.Now - 1000 * 60 * 60 * 24 * 31) & " Page: 1   2   3   4   5   6   7   Powered by ColBERT |