HomeWiki
HomeWiki
  1. Utils
  • Back to home
  • 2. Connectivity
  • Introduction
  • Custom Script
  • Playground
  • Database Explorer
  • Log Stream
  • Direct Communication
  • Softone
    • Getting Started
  • Datapump
    • Getting Started
    • Crons
    • Legacy Windows Support
    • SDK
      • DB
        • _executeQuery
        • _executeStoreProcedure
        • _executeInsertQuery
        • _executeInsertQueriesInTransaction
      • Import
        • _productsImport
        • _categoriesImport
        • _brandsImport
        • _attributesImport
        • _attributeSetsImport
        • _unitsImport
        • _quantityImport
        • _customersImport
        • _contactsImport
        • _callsImport
        • _eventsImport
        • _tasksImport
        • _ordersImport
        • _usersImport
        • _customerSourceTagsImport
        • _productSourceTagsImport
      • Log
        • _logDebug
        • _logInfo
        • _logWarn
        • _logError
      • Web Requests
        • _httpGetJson
        • _httpPostJson
        • _httpPutJson
        • _httpDeleteJson
        • _httpPatchJson
      • Variables
        • _saveVariable
        • _getVariable
        • _deleteVariable
      • Blob
        • _blobConnect
        • _blobExists
        • _blobGet
        • _blobFind
      • Utils
        • _encodeBase64
        • _sleep
        • _getLastSyncDate
        • _updateLastSyncDate
        • _resetLastSyncDate
  1. Utils

_getLastSyncDate

Documentation: _getLastSyncDate Function#

The _getLastSyncDate function retrieves the timestamp of the last synchronization for a specified job. The timestamp is returned in a standardized format to facilitate time comparisons and logging.

Function Signature:#

Parameters:#

jobname:
Description: The name of the job for which the last synchronization date is requested. This parameter helps identify the specific job whose synchronization timestamp needs to be retrieved.
Type: string
Example:

Return Value:#

Returns:
A string representing the last synchronization date of the specified job, encoded in the format "yyyy-MM-ddTHH:mm:ss.fff". This format includes:
Year: 4-digit year
Month: 2-digit month
Day: 2-digit day
Hour: 2-digit hour (24-hour clock)
Minute: 2-digit minute
Second: 2-digit second
Millisecond: 3-digit millisecond
Type: string
Example:

Function Workflow:#

1.
Receive Job Name:
The function accepts the name of the job as input to identify which job's last synchronization date is being queried.
2.
Retrieve Synchronization Date:
The function queries the system for the last synchronization timestamp associated with the specified job.
3.
Format Date:
The retrieved date is formatted into the "yyyy-MM-ddTHH:mm:ss.fff" format.
4.
Return Formatted Date:
The function returns the formatted date string.

Example Usage:#

Important Considerations:#

Job Name Accuracy:
Ensure the jobname parameter accurately matches the job's name as used in the system to retrieve the correct synchronization date.
Date Format:
The returned date is in a specific format. Ensure that any further processing or comparison of this date string accounts for the format to avoid misinterpretation.
Time Zone:
The timestamp is typically represented in UTC. Ensure that time zone conversions are handled appropriately if necessary.
By using _getLastSyncDate, you can efficiently retrieve and utilize the last synchronization timestamp for specific jobs, aiding in monitoring and scheduling tasks.
Previous
_sleep
Next
_updateLastSyncDate
Built with