SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
anandbillava
Fluorite | Level 6
Can somebody let me know how do we convert the UTC date time to other timezone values.

Is there any SAS functiion for this ?
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Use the INTNX function to adjust a DATETIME type SAS variable after inputting it. Also, you may find prior posts on these forums, as well as SAS-hosted DOC and supplemental technical / conference reference material (suggesting website SEARCH or using Google advanced search below).

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

utc datetime values intnx function site:sas.com
chang_y_chung_hotmail_com
Obsidian | Level 7
If you have a datetime value in UTC, just subtract 5 hours to get EST:



   data _null_;

     utc = '15mar2011 21:15:21'dt;

     est = utc - 5*60*60;

     format utc est datetime.;

     put (_all_) (/=);

   run;

   /* on log

   utc=15MAR11:21:15:21

   est=15MAR11:16:15:21

   */
anandbillava
Fluorite | Level 6
I have done similar program. But I am asking is there a function which does it autromatically... by taking locale as a input parameter.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Locale, as in some GMT offset somewhere out in the operating system enviroment?

Not likely - check the DOC and consider using INTNX with your adjustment as argument #3.

Scott Barry
SBBWorks, Inc.
chang_y_chung_hotmail_com
Obsidian | Level 7
> ...is there
> a function which does it autromatically... by taking
> locale as a input parameter.

No, there isn't one among the built in.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 9341 views
  • 0 likes
  • 3 in conversation