Using PnP JS for brevity. I am having major difficulty figuring out what date time format the following requires.

Use case: I have date time for my last cache, I want to get the differences in my list since then. Any help great appreciated.

const SOMEDATE= I have no idea  

const changeTokenStart = `1;3;${resource};${SOMEDATE};-1`;

const changeQuery: IChangeQuery = {
    Add: true,
    Update: true,
    Item: true,
    ChangeTokenEnd: null,
    ChangeTokenStart: { StringValue: changeTokenStart },

const r = await list.getChanges(changeQuery);

2 Answers 2


You can use date time in below format:

const SOMEDATE = new Date("2022-02-22").getTime();

const changeTokenStart = `1;3;${resource};${SOMEDATE};-1`;

Basically, you have to pass the number of milliseconds since January 1, 1970 00:00:00 - getTime() function returns the same

Documentation: Get changes on a list

  • Hi @Powell, did you try this? let me know if you need any further help with this. Oct 13, 2022 at 10:58
  • Hi @Powell, Please Upvote(^) and accept as an Answer if it helped you in any way & it will help others with similar question in future to find the correct answer easily. Feb 24 at 7:26

According to my research and testing, please follow the following date time format:

const changeStart = new Date("2022-10-10").getTime();

Hope it can help you. Thanks for your understanding and support.

  • Which is exactly what I have explained in my answer below! Oct 13, 2022 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.