B4J Question DateTime.DateFormat

BeneBarros

Active Member
Licensed User
Longtime User
Server.
I have some handler classes where I need to manipulate dates. I am using DateTime.DateFormat to change.
Question: Is there a possibility that another class is running at the same time and generates errors in dates?
 
Last edited:
Which types of errors do you encounter?

example:

Code: Copy
Public Sub SDate_to_NormalDate(sd As String) As String
    If sd = "-1" Then Return sd
    Dim dtf As String = DateTime.DateFormat
    DateTime.DateFormat = "yyyyMMdd"
    Dim lng As Long = DateTime.DateParse(sd)
    DateTime.DateFormat = dtf
    Dim res As String =  DateTime.Date(lng)
    Return res
End Sub

in this time interval the date in another class that is running can generate an error?
I had a problem with the date, but I couldn't find the reason. I imagine this is it.
 
Last edited:
Upvote 0
You haven't posted the error message.

This code isn't supposed to cause any problem. Each thread has its own instance of DateTime.
Thanks Erel ... I will ask the customer to save the error message screen. If it happens again. Probably the error is not there, because if each thread has an instance of Datetime.
 
Upvote 0
Back
Top