Current Year

Dman

Active Member
Licensed User
Longtime User
I need to get the current year in a field. I am having a major brain fart and can't seem to get it. I know it is an easy thing to do more than likely but I just can't seem to figure it out.
 

Dman

Active Member
Licensed User
Longtime User
I think I might have figured it out. Is this correct?

B4X:
       Dim now As Long
          Dim year As Long
                          now = DateTime.now
           year = DateTime.GetYear(now)
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Here it is:
B4X:
Dim MyYear As Int
MyYear=DateTime.GetYear(DateTime.Now)
Msgbox(MyYear,"Current year")
displays 2012
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Here it is:
B4X:
Dim MyYear As Int
MyYear=DateTime.GetYear(DateTime.Now)
Msgbox(MyYear,"Current year")
displays 2012

My friend, dimming year as an int, will lead your app to crash in the year 2,147,483,648. Just kidding.:sign0079: :sign0136:
 
Upvote 0
Top