1. Alexander Stolte

    Android Code Snippet [B4X] isCurrentMonth, isSameYear, isSameWeek, isLastWeek

    can certainly still be optimized. Private Sub isCurrentMonth(ticks As Long) As Boolean Return DateTime.GetYear(ticks) = DateTime.GetYear(DateTime.Now) And DateTime.GetMonth(ticks) = DateTime.GetMonth(DateTime.Now) End Sub Private Sub isSameYear(ticks_1 As Long,ticks_2 As Long) As...
  2. Mashiane

    B4J Question [BANano] Compiling DateUtils Help

    Hi there I found the source code of DateUtils here in the forum and been trying to compile it to make it work with BANano so that I can use the functions here. This is the B4J sub.. Thanks!

    Android Question changing date timezone with DateUtils

    hello, to check the DateUtils.SetDateAndTime2 timestamp, I had trying that code : 'for the datetime = 08/05/2019 14:43:00 Dim mats As Long = DateUtils.SetDateAndTime2(2019, 8, 5, 14, 43, 0, 1) 'with UTC/GMT + 1 Log(mats) 'return : 1565012580000 Dim MyDate As Long =...
  4. rleiman

    Android Question [SOLVED] Return a leading zero if needed using DateTime.GetHour

    Hi Everyone, Using the code below, is there a way to have GetHour and GetMinute display a "0" in front of the string if the returned value is less than 10? If the converted hours = "9" for 9 in the morning, I would like the returned string to have "09" in it. Dim strMyTimeString As String...
  5. LucaMs

    Android Question DateUtils - PeriodBetween

    adpUserBirth is an AnotherDatePicker: Sub adpUserBirth_DateChanged (NewDate As Long) DateTime.DateFormat = "MM/dd/yyyy" ' just to be sure Dim PerDiff As Period PerDiff = DateUtils.PeriodBetween(NewDate, DateTime.Now) Log("New date: " & DateTime.Date(NewDate)) Log("Today : "...
  6. R

    Android Question Problem with DateUtils

    Using the latest DateUtils library, 1.05. Running this code: Dim lDate As Long lDate = DateUtils.SetDate(1970,1,1) Log(lDate) I expect this to produce 0, but instead I get 3600000 Any idea what I might be doing wrong? RBS