-
Notifications
You must be signed in to change notification settings - Fork 1
AcuDateTime Operators
- AcuDateTime (including milliseconds)
- AcuDateTime2 (without milliseconds)
- AcuDateTimeNow (current time, including milliseconds)
Converts date strings to Acumatica-compatible datetime format with milliseconds.
The acudatetime operator converts various date string formats into Acumatica's standard datetime format: yyyy-MM-dd HH:mm:ss.fff. It handles ISO 8601 formats and strips trailing zeros from milliseconds while preserving up to 3 decimal places.
| Parameter | Type | Description |
|---|---|---|
| dateString | String | The date string to convert. Can be any format parseable by .NET DateTime or ISO 8601 format like "2022-06-02T09:25:36.0830000" |
Returns a date string in format yyyy-MM-dd HH:mm:ss.fff (e.g., "2022-06-02 09:25:36.083").
Returns an empty string if the input is null, empty, or whitespace.
<Field name="CreatedDateTime">acudatetime($Created)</Field>
<Field name="ModifiedDateTime">acudatetime($LastModified)</Field>| Created | LastModified |
|---|---|
| 2022-06-02T09:25:36.0830000 | 2023-01-15 14:30:00 |
| 2021-12-25T00:00:00.0000000 | 12/31/2022 23:59:59 |
| 2024-03-10T15:45:30.1234567 |
| CreatedDateTime | ModifiedDateTime |
|---|---|
| 2022-06-02 09:25:36.083 | 2023-01-15 14:30:00.000 |
| 2021-12-25 00:00:00 | 2022-12-31 23:59:59.000 |
| 2024-03-10 15:45:30.123 |
-
Parseable dates: If the input can be parsed by .NET's
DateTime.TryParse(), it's formatted asyyyy-MM-dd HH:mm:ss.fff -
ISO 8601 format: For strings like "2022-06-02T09:25:36.0830000":
- Replaces "T" with a space
- Strips trailing zeros from milliseconds
- Truncates to 3 decimal places if more are present
- If all milliseconds are zero, omits the decimal part
- The operator preserves up to 3 decimal places for milliseconds
- Trailing zeros in milliseconds are removed
- Empty or whitespace input returns an empty string
- The "T" separator in ISO 8601 format is replaced with a space
Converts date strings to Acumatica-compatible datetime format without milliseconds.
The acudatetime2 operator converts various date string formats into Acumatica's datetime format without milliseconds: yyyy-MM-dd HH:mm:ss. This is useful when millisecond precision is not needed or not supported by the target field.
| Parameter | Type | Description |
|---|---|---|
| dateString | String | The date string to convert. Can be any format parseable by .NET DateTime or ISO 8601 format like "2022-06-02T09:25:36.0830000" |
Returns a date string in format yyyy-MM-dd HH:mm:ss (e.g., "2022-06-02 09:25:36").
Returns an empty string if the input is null, empty, or whitespace.
<Field name="CreatedDate">acudatetime2($Created)</Field>
<Field name="ModifiedDate">acudatetime2($LastModified)</Field>| Created | LastModified |
|---|---|
| 2022-06-02T09:25:36.0830000 | 2023-01-15 14:30:00 |
| 2021-12-25T00:00:00.0000000 | 12/31/2022 23:59:59 |
| 2024-03-10T15:45:30.1234567 |
| CreatedDate | ModifiedDate |
|---|---|
| 2022-06-02 09:25:36 | 2023-01-15 14:30:00 |
| 2021-12-25 00:00:00 | 2022-12-31 23:59:59 |
| 2024-03-10 15:45:30 |
-
Parseable dates: If the input can be parsed by .NET's
DateTime.TryParse(), it's formatted asyyyy-MM-dd HH:mm:ss -
ISO 8601 format: For strings like "2022-06-02T09:25:36.0830000":
- Replaces "T" with a space
- Completely removes all milliseconds/fractional seconds
- Empty input: Returns empty string
| Feature | acudatetime | acudatetime2 |
|---|---|---|
| Output format | yyyy-MM-dd HH:mm:ss.fff |
yyyy-MM-dd HH:mm:ss |
| Milliseconds | Included (up to 3 decimals) | Excluded |
| Use case | When precision is needed | When precision is not needed |
- All milliseconds are stripped from the output
- Empty or whitespace input returns an empty string
- The "T" separator in ISO 8601 format is replaced with a space
- This is the preferred operator when the target Acumatica field is defined as
DateTimewithout fractional seconds
Returns the current date and time in Acumatica-compatible format.
The acudatetimenow operator outputs the current system date and time in Acumatica's standard datetime format with milliseconds: yyyy-MM-dd HH:mm:ss.fff. This is useful for populating audit fields like CreatedDateTime or LastModifiedDateTime with the current timestamp.
This operator takes no parameters.
Returns the current date and time as a string in format yyyy-MM-dd HH:mm:ss.fff (e.g., "2025-11-16 14:30:25.847").
<Field name="ImportedDateTime">acudatetimenow()</Field>
<Field name="ProcessedDateTime">acudatetimenow()</Field>
<Field name="CreatedDateTime">acudatetimenow()</Field>| ImportedDateTime | ProcessedDateTime | CreatedDateTime |
|---|---|---|
| 2025-11-16 14:30:25.847 | 2025-11-16 14:30:25.847 | 2025-11-16 14:30:25.847 |
Note: All records in the same transformation run will have the same or very similar timestamps since they are generated at execution time.
- Audit trails: Populate CreatedDateTime, LastModifiedDateTime fields
- Import tracking: Mark when data was imported
- Batch processing: Timestamp records with processing time
- Data versioning: Track when records were generated
- Returns the current system time at the moment the operator is evaluated
- Includes milliseconds (3 decimal places)
- Each record may have slightly different timestamps depending on processing speed
- Uses the system's local time zone
- This operator requires no arguments - use
acudatetimenow()without parameters - The timestamp reflects when the transformation is running, not when the source data was created
- For converting existing date strings, use
acudatetimeoracudatetime2instead - Milliseconds are included in the output format