B4A Code Snippet Convert timestamp date to Brasil format - Douglas Farias    Dec 3, 2018   (4 reactions) Hi. here is a simple code to convert a timestamp to Brasil format, easy to modify to another countrys format. Sub Timestamp_Brasileiro(dataTimeStamp As String) As String DateTime.DateFormat = "yyyy-MM-dd" : DateTime.TimeFormat = "HH:mm:ss" 'TRANSFORMA DATA DO CEL EM...) Private ltempo As Long = DateTime.DateTimeParse(dataTempo(0),dataTempo(1)) DateTime.DateFormat = "dd/MM/yyyy" : DateTime.TimeFormat = "HH:mm" 'VOLTAMOS A DATA PARA O PADRÃO... B4A Question Delay in Time - ilan (first post)    Feb 11, 2024   (6 reactions) Sub
Sub Activity_Create(FirstTime As Boolean)
Timer1.Initialize("tmr",1000)
Timer1.Enabled = True
End Sub
Sub tmr_tick
DateTime.TimeFormat = "hh:mm:ss"
Label1.Text = DateTime.Time(DateTime.Now)
End Sub
150726
DateTime.TimeFormat = "HH:mm:ss"... B4J Code Snippet Icon System Tray Example (Inline Java version) - jkhazraji    Mar 15, 2025   (3 reactions) notificationTimer = new Timer(); private SimpleDateFormat timeFormat = new SimpleDateFormat...() { trayIcon.displayMessage("Reminder", "Current time: " + timeFormat.format(new... java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; import java.util.TimerTask;... B4A Question Get time and date since epoch with time dialog - jimseng (first post)    Apr 25, 2024   (1 reaction) Thanks. I get Unparseable date: "2024-04-25" but I can work with it. i just need to learn about DateTime.DateFormat and DateTime.TimeFormat and I think I have something I can use. Very helpful.... B4A Question Verify a valid date - netsistemas (first post)    Jun 9, 2022   (1 reaction) and for verify a time: Sub IsTimeHHmm(Time As String) As Boolean Try Dim PreviousFormat As String PreviousFormat = DateTime.TimeFormat DateTime.TimeFormat= "HH:mm" DateTime.TimeParse(Time) DateTime.TimeFormat= PreviousFormat Return True Catch Log(LastException) Return False End Try End Sub... 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 String to Time - Mahares (first post)    Sep 4, 2022   (3 reactions) Another solution:
DateTime.TimeFormat="HH:mm:ss"
Log(DateTime.Time(DateTime.Now)) '16:35:00
DateTime.TimeFormat="hh:mm a" 'if you do not want the am/pm make it hh:mm
Log(DateTime.Time(DateTime.Now)) '04:35 AM... B4i Question XUI.View problems - Claude Brun (first post)    Nov 19, 2023 ) As Long Dim df = DateTime.DateFormat, tf = DateTime.TimeFormat As String DateTime.DateFormat = "GGyyyyMMdd" DateTime.TimeFormat = "HHmmss" Dim d As String...) Try Dim ticks As Long = DateTime.DateTimeParse(d, t) Catch DateTime.DateFormat = df DateTime.TimeFormat = tf Log("Error: Invalid value: " & d &... Try DateTime.DateFormat = df DateTime.TimeFormat = tf Return ticks End Sub Without... Italian Giorno della settimana con B4i - Sagenut (first post)    Dec 21, 2024 Prova ad aggiungere queste righe #If B4i Dim loc As NativeObject loc = loc.Initialize("NSLocale").RunMethod("localeWithLocaleIdentifier:", Array("it_IT")) Dim no As NativeObject = DateTime no.GetField("dateFormat").SetField("locale", loc) no.GetField("timeFormat").SetField("locale", loc) #End If... B4A Question Inaccurate GSP-time with Garmin-GLO-2 (Bluetooth-GPS-Receiver) - Filippo    Dec 9, 2024 = DateTime.TimeFormat offspan = DateTime.GetTimeZoneOffsetAt(DateTime.now) * DateTime.TicksPerHour... word.Length Case 6 DateTime.TimeFormat = "HHmmss" Case 8 DateTime.TimeFormat = "HHmmss.S" Case 9 DateTime.TimeFormat = "HHmmss.SS" Case 10 DateTime.TimeFormat = "HHmmss.SSS" End Select location1.Time = DateTime.TimeParse(word) + offspan DateTime.TimeFormat... Page: 1   2   3   4   5   6   7   |