Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Local Timezone to UTC

Avatar

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
vidyas77336264
Level 1

30-06-2019

Hi All,

I'm building a custom adobe campaign classic function to convert current date to UTC. But irrespective of what method I use, I'm getting nowhere. Getting below errors.

Custom_SQL_Function.jpgCustom_SQL_Function_Error.jpg

Where am I going wrong? Can we convert Local time to UTC in postgres?

Note: I can do it using JS activity but won't be able to create a custom function.

I have also tried with: select Timestamp with '2019-07-01 10:30:00-05' AT TIME ZONE 'UTC'.

Thanks,

Vidya Shivakumar

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
vidyas77336264
Level 1

07-07-2019

Hi All,

Thanks for your inputs.Below code worked:

LocalToUTCSql.jpg

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
asariaaara
Level 3

03-07-2019

Hi,
Not a pro at SQL, but i guess timestamp will itself reflect timezone of system i.e. current timezone.

Maybe you should simply try without "with timezone Now()".

Let me know about the solution.  

Regards.

Avatar

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
asariaaara
Level 3

Likes

18 likes

Total Posts

48 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
asariaaara
Level 3

01-07-2019

Hi vidyas77336264​,
Cant you directly use the option found in properties of workflow.

Regards.

Avatar

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
vidyas77336264
Level 1

03-07-2019

Hi asariaaara​, Thanks for the suggestion.

What do you mean options in Workflow properties? Timezone field in the General Tab?

This won't help either, when you use GetDate() function it still gives you the DB time which is set to my local time zone.

Thanks,

Vidya