Salesforce

Date and Time Functions with Database Date and Time Values (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Date and Time Functions with Database Date and Time Values (Magic xpa 3.x)

Objective

Magic xpa has Date and Time functions that return current machine date and time values. Sometimes, you might want to override these functions to return values other than the date and time of the current machine.

For example: If you build a client server application, and date and time values should be equal between all clients (regardless the local time of the client), the Date and Time functions should return the date and time of the central application database or the central machine's date and time values.

Solution

To replace Date and Time functions, there are two main options to override the current client machine date and time values:

  1. You can override and create two functions in the main program by the name of "Date" and "Time", and then create your own logic in these functions. This means that you can call any program that accesses your DB or central machine to get your desired values.

  2. You can use a DSQL program that calls a procedure or uses a SELECT statement that employs the native database function of date and time functions like "GETDATE" in the MSSQL DB. In this case, you should consider the precision issue of time values returned from the DB.

Reference
Attachment 
Attachment