Android Question How to get day, month and year in different variables?

mcqueccu

Well-Known Member
Licensed User
Longtime User
B4X:
    DateTime.DateFormat = "yyyy/MM/dd"   
    Dim today As Long = DateTime.DateParse("2025/12/07") '<-----------For Custom date
    
    'OR THIS
    'Dim today As Long = DateTime.Now '<-------Get details of the current date
    Dim year As Int = DateTime.GetYear(today)
    Dim month As Int = DateTime.GetMonth(today)
    Dim day As Int = DateTime.GetDayOfMonth(today)
    
    Log(today)
    Log(year)
    Log(month)
    Log(day)
 
Upvote 1

emexes

Expert
Licensed User
Longtime User
We'll have to do some manipulations with it later.

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…