Dim now As Long
Dim df As String
Dim date_string As String
DateTime.DateFormat = "yyyyMMdd"
DateTime.TimeFormat = "HHmmss"
date_string=DateTime.Date(now) & "_" & DateTime.Time(now)
Msgbox("The date is: " & date_string, "")
if I do msgbox(datetime.date(now),"") etc it works. Where am I going wrong here?
I cannot see any errormessage. Maybe you missed it to post here?
Maybe you did not explain what you expect and what you get.
B4X:
Dim df As String
Dim date_string As String
DateTime.DateFormat = "yyyyMMdd"
DateTime.TimeFormat = "HHmmss"
date_string=DateTime.Date(DateTime.Now) & "_" & DateTime.Time(DateTime.Now)
Msgbox("The date is: " & date_string, "")
My mistake. when changing from the example code which was
Msgbox("The date is: " & DateTime.Date(now) & CRLF & _"The time is: " & DateTime.Time(now), "")
to using a string variable, I accidentally deleted the line now = DateTime.Now
Then, the date was displayed: 19691231_190000
I am not really familiar with the syntax yet. and iam not happy with the documentation ( too view examples -compared to bascom- ) so I get annoyed and ask many questions. )
Exactly. If you dont give it a value its probably 0 or something
Which really made me wonder, as I thought unix time is 1.1.1970, 0:0:0 -> But thats probably because the timezone is not right on my AVD.
If anyone wonders, what iam trying to end up with: The timecode is used to name files. Like that the files are in an alphabetical (numeric) order.
I personally dont like special characters in files, : is possible i think but / should not work with filenames....