B4J Question [BANano] [SOLVED] Request list of DateTime Functions & Date Time Formats supported?

Mashiane

Expert
Licensed User
Longtime User
Ola

Is there a list of all the functions / date time formats that we can get that are supported for the DateTime object in BANano?

B4X:
'convert a string to a date
Sub DateIconv(sDate As String) As Long
    Dim lng As Long
    Dim OrigFormat As String=DateTime.DateFormat
    If sDate.Length > 10 Then
        DateTime.DateFormat = "yyyy-MM-dd"
        DateTime.DateFormat = "HH:mm:ss"
        Dim d As String = sDate.SubString2(0,11)
        Dim t As String = sDate.SubString(12)
        lng = DateTime.DateTimeParse(d,t)
    Else
        DateTime.DateFormat = "yyyy-MM-dd"
        lng = DateTime.Dateparse(sDate)
    End If
    DateTime.DateFormat=OrigFormat
    Return lng
End Sub

This will help for building some date based functions. For example, just noted that this is not supported.

B4X:
lng = DateTime.DateTimeParse(d,t)

Thanks.
 

alwaysbusy

Expert
Licensed User
Longtime User
Now,DateParse,TimeParse,Date,Time,Dateformat,TimeFormat,Add,GetYear,GetMonth,GetDayOfMonth,GetDayOfYear,GetDayOfWeek,GetHour,GetMinute,GetSecond,GettimezoneOffsetAt,TicksPerDay,TicksPerHour,TicksPerMinute,TicksPerSecond,TimezoneOffset,SetTimeZone

For more advanced Date and Time functionalities use an external library like moment.js
 
Upvote 0

Anurag Jain

Member
Licensed User
Now,DateParse,TimeParse,Date,Time,Dateformat,TimeFormat,Add,GetYear,GetMonth,GetDayOfMonth,GetDayOfYear,GetDayOfWeek,GetHour,GetMinute,GetSecond,GettimezoneOffsetAt,TicksPerDay,TicksPerHour,TicksPerMinute,TicksPerSecond,TimezoneOffset,SetTimeZone

For more advanced Date and Time functionalities use an external library like moment.js
Hi, where can we find this library, moment.js
 
Upvote 0
Top