rfresh Well-Known Member Licensed User Longtime User Apr 19, 2012 #1 I looked at the DateTime docs but I don't understand how to use the DateFormat to show the year as '12' vs '2012'? 04/18/12 vs 04/18/2012. Thanks for any help...
I looked at the DateTime docs but I don't understand how to use the DateFormat to show the year as '12' vs '2012'? 04/18/12 vs 04/18/2012. Thanks for any help...
rfresh Well-Known Member Licensed User Longtime User Apr 19, 2012 #3 How do I use that? I'm using this now: B4X: Dim date, time As Long date = DateTime.Now DateTime.date(date) So how would I use that date format mask? And are there docs on how to format time? I want to use am/pm format for my times. B4X: DateTime.time(date) Upvote 0
How do I use that? I'm using this now: B4X: Dim date, time As Long date = DateTime.Now DateTime.date(date) So how would I use that date format mask? And are there docs on how to format time? I want to use am/pm format for my times. B4X: DateTime.time(date)
margret Well-Known Member Licensed User Longtime User Apr 19, 2012 #4 It should be like: B4X: 'Sample from Wiki Dim now as Long Dim dt as String now = DateTime.Now DateTime.DateFormat = "MM/dd/yy" dt = DateTime.Date(now) Msgbox(dt, "MM/dd/yy") Last edited: Apr 19, 2012 Upvote 0
It should be like: B4X: 'Sample from Wiki Dim now as Long Dim dt as String now = DateTime.Now DateTime.DateFormat = "MM/dd/yy" dt = DateTime.Date(now) Msgbox(dt, "MM/dd/yy")
rfresh Well-Known Member Licensed User Longtime User Apr 19, 2012 #5 Is time formatting similar? Upvote 0
M Mahares Expert Licensed User Longtime User Apr 19, 2012 #6 This is the way I format time the way you want it: B4X: DateTime.TimeFormat="h:mm:ss a" DateTime.Time(now) ' example: 6:35:19 PM Upvote 0
This is the way I format time the way you want it: B4X: DateTime.TimeFormat="h:mm:ss a" DateTime.Time(now) ' example: 6:35:19 PM
rfresh Well-Known Member Licensed User Longtime User Apr 20, 2012 #7 margret said: It should be like: B4X: 'Sample from Wiki Dim now as Long Dim dt as String now = DateTime.Now DateTime.DateFormat = "MM/dd/yy" dt = DateTime.Date(now) Msgbox(dt, "MM/dd/yy") Click to expand... May I get that Wiki URL reference please? Thanks... Upvote 0
margret said: It should be like: B4X: 'Sample from Wiki Dim now as Long Dim dt as String now = DateTime.Now DateTime.DateFormat = "MM/dd/yy" dt = DateTime.Date(now) Msgbox(dt, "MM/dd/yy") Click to expand... May I get that Wiki URL reference please? Thanks...
J Jost aus Soest Active Member Licensed User Longtime User Apr 20, 2012 #8 DateTime - Basic4android Wiki Upvote 0