getTimeParting 6.2, how can I get month in numeric? | Community
Skip to main content
Level 2
October 9, 2023
Solved

getTimeParting 6.2, how can I get month in numeric?

  • October 9, 2023
  • 1 reply
  • 813 views

Previously we were getting 9/27/2023|4:02 AM|Wednesday this format, Now with the 6.2 version the output is year=2023 | month=September | date=27 | day=Wednesday | time=11:35 PM.

I tired different things but unable to get month in numeric format.

any tips?

 

Also explain  a = /([a-zA-Z]+).*?([a-zA-Z]+).*?([0-9]+).*?([0-9]+)(.*?)([0-9])(.*)/.exec(a);

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuhuisg

Looks like the plug-in did away with your old format since its version 4.0 update in August 2016. To get back your desired value, you'll need to use some custom code to convert the plug-in's returned values to what you want.

Something like this:

 

// use this inside your AA extension's custom code's doPlugins section const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; const timePartingString = s.getTimeParting(); const timePartingParts = timePartingString.split('|').map((value) => value.split('=')[1].trim()); const [timePartingYear, timePartingMonth, timePartingDay, timePartingDayOfWeek, timePartingTime] = timePartingParts; s.eVarXX = `${monthNames.indexOf(timePartingMonth) + 1}/${timePartingDay}/${timePartingYear}|${timePartingTime}|${timePartingDayOfWeek}`;

 

 

Please test this code properly before publishing it to live!

1 reply

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAccepted solution
Community Advisor
October 9, 2023

Looks like the plug-in did away with your old format since its version 4.0 update in August 2016. To get back your desired value, you'll need to use some custom code to convert the plug-in's returned values to what you want.

Something like this:

 

// use this inside your AA extension's custom code's doPlugins section const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; const timePartingString = s.getTimeParting(); const timePartingParts = timePartingString.split('|').map((value) => value.split('=')[1].trim()); const [timePartingYear, timePartingMonth, timePartingDay, timePartingDayOfWeek, timePartingTime] = timePartingParts; s.eVarXX = `${monthNames.indexOf(timePartingMonth) + 1}/${timePartingDay}/${timePartingYear}|${timePartingTime}|${timePartingDayOfWeek}`;

 

 

Please test this code properly before publishing it to live!

Level 2
October 10, 2023

Thank you, It worked with few changes.