Sync AD password last set attribute downstream

Hi,
I am trying to sync the password last set attribute that is read from AD into a ServiceNow attribute.
The challenge I’m facing is that the attribute is in UTC. What would be the best way to convert it into PST. We cannot do a addition or subtraction since Day Light Savings affects the time.

Any Advice?

Hi @aaron11 - what format is the UTC date in? Millis or something else?

202603311505 Example
YYYYMMDDHHmm

From a usage of the synced data perspective, do you really care about it down to the hour? …So is it just fluff?

To take a Day Light Saving time in effect you need to implement a Lookup Transform that checks the current month to determine whether to subtract 7 hours (PDT) or 8 hours (PST).

Create a new transform (e.g., “Pacific Time DST Adjuster”) using this structure:

{
    "name": "AD PwdLastSet to Pacific",
    "type": "lookup",
    "attributes": {
        "input": {
            "type": "dateFormat",
            "attributes": {
                "input": {
                    "type": "accountAttribute",
                    "attributes": {
                        "sourceName": "Active Directory",
                        "attributeName": "pwdLastSet"
                    }
                },
                "inputFormat": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
                "outputFormat": "MM"
            }
        },
        "table": {
            "03": "-7h", "04": "-7h", "05": "-7h", "06": "-7h", 
            "07": "-7h", "08": "-7h", "09": "-7h", "10": "-7h", "11": "-7h",
            "default": "-8h"
        }
    }
}

Nest the lookup transform inside a Date Math transform to apply the resulting offset to your final ServiceNow attribute.

inputDate + (Offset from Lookup)
This ensures that during summer months, it subtracts 7 hours, and during winter, it subtracts 8.

Hi @aaron11 Have you considered not converting it? There is a reason that systems use UTC.

technically, PST is Pacific Standard Time, which is specifically no Daylight Savings Time. PDT is Pacific Daylight Time. if you need your function to be DST-aware, you either have to build out logic to determine whether you’re in DST or not based on the date, or you can update it back and forth twice a year.

Also, not sure where you are located (or where the solution is for)…but BC (Canada) won’t be dealing with fall-back/spring-forward anymore.