dateutils

  1. LucaMs

    Wish [B4X] B4XDateUtils

    [I'm not sure if what I'm about to write is correct, I'm only now messing around with these things and I don't have the patience to look for everything] If I'm not mistaken there is no B4XDateUtils, there is a library for each platform. It would be better to have a B4XDateUtils. I'm using B4J...
  2. M

    iOS Question Type Period dont work in b4i

    Hello everyone, the type period that serves to work with dateutils in b4i doesn't work? whenever I put it in the code, b4i returns an error B4i Version: 7.80 Sub Class_Globals Private Root As B4XView Type Period (Years As Int, Months As Int, _ Days As Int, Hours As Int...
  3. mmieher

    Android Question DateUtils Period Difference

    Must be missing something simple... "9" is not the correct number of days between 7/1/2021 and 12/10/2021 Dim DateSobriety As String = iMap.Get("datesobriety") ' this is 2021-07-01 in database DateTime.DateFormat = "yyyy-MM-dd" Dim StartTime As Long =...
  4. A

    Android Question DST problem

    Hi all. I have a problem with DateUtils.AddPeriod and DST which is In the USA today November, 7 2021 Here is my code Private Sub GetStrTo(strFrom As String, AddHour As Int) As String Try Dim Arr() As String Dim NotTimeDate As String,NoteTimeStr As String...
  5. 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...
  6. Mashiane

    B4J Question [BANano] [SOLVED] 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!
  7. ALBRECHT

    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 =...
  8. 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...
  9. 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 : "...
  10. 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
Top