dateformat example

Cor

Active Member
Licensed User
Longtime User
Can you give an example how to show the following in a datetime.dateformat

datetime.dateformat("dd/MM/yyy ?????")

activity.Title=DateTime.Add(DateTime.Now,0,0,1) ;

grCor
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
DateTime.DateFormat is a property, not a method.

dateformat_icon.png


The box icon represents properties. If it were a method the first line in the description, which is the signature line, would have included a parameter.

So your code should be:
B4X:
DateTime.DateFormat = "..."
 

Cor

Active Member
Licensed User
Longtime User
the following shows only numbers in title

or am i missing something

DateTime.DateFormat="dd/MM/yyyy"
activity.Title=DateTime.Add(DateTime.Now,0,0,1)

grCor
 

klaus

Expert
Licensed User
Longtime User
What do you want to display in the title line ?

If you want to display the current date you should use this:
Activity.Title=DateTime.Date(DateTime.Now)

If you want to diplay the current date and time you should use this:
Activity.Title=DateTime.Date(DateTime.Now)&" "&DateTime.Time(DateTime.Now)

If you want to the date of tomorrow you should use this:
Activity.Title=DateTime.Date(DateTime.Add(DateTime.Now,0,0,1))

Best regards.
 

derez

Expert
Licensed User
Longtime User
I have a strange phenomena. I use this

B4X:
datetime.time(DateTime.Now-stopwatch_start)
to show time pass from the second I press a button which allocates the value datetime.now to stopwatch_start (as int), while the program runs in cycles by a timer.

The first value that I get is 01:56:28 instead of 0 or 1 second.

Are the ticks not integers ?
 
Top