Android Question Function StringFunctions.Today

Pesciolina

Active Member
Licensed User
hello everyone,
I'm migrating to B4X and with great surprise with the function in question it returns the date in another format

Version old B4A 2024.01.11
Version B4X 11/01/2024

How is it possible ?

Thank You
Marco
 

Pesciolina

Active Member
Licensed User
correct, but why do I find myself having an Italian date?
To make up for it I switched to this function
B4X:
Dim Oggi As String
DateTime.DateFormat = "ddMMyyyy"
Oggi = DateTime.Date(DateTime.Now)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Perché se chiami una variabile "Oggi", l'intelligenza artificiale di B4A capisce che vuoi la data in formato italiano; o forse sei italiano e lo è anche l'impostazione di default del tuo dispositivo 😄

Because if you name a variable "Oggi", B4A's artificial intelligence understands that you want the date in Italian format; or maybe you are Italian and so is your device's default setting😄
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
How is it possible ?
Perhaps the cause is very simple, every programming language has an (unwritten) rule that you cannot use command names reserved for the programming language as a name for a variable. A possible solution is to choose the variable name to write it incorrectly as ogi or by adding the variable type as oggiStr.
 
Upvote 0

Pesciolina

Active Member
Licensed User
excuse me, I'm an accountant who, thanks to Erel, manages to have fun creating apps for my hobby.
This App is from 2017 and up to now it has always worked well for me.
Thank you all
 
Upvote 0
Top