For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > January 2006 > Convert utc to local time?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Convert utc to local time?
agonzalez

2006-01-24, 3:59 am

Does CR provide a function or is there any trick to convert dates stored
on SQL server in utc format to the report viewers' local time?

I've googled for this but come up empty...

Thanks,

Alex
TomB.

2006-01-26, 7:07 pm

When you say 'convert the UTC format to the viewer's local time, do you mean
you only want the time stored to show or the local CurrentTime to show?

To convert the UTC to show the time only, RightClick the field, Click on
Format Field, Click the "Date and Time" tab, and select the format that best
represents what you want to see.

Sorry for not understanding "report viewers local time'.

TomB.

"agonzalez" wrote:

> Does CR provide a function or is there any trick to convert dates stored
> on SQL server in utc format to the report viewers' local time?
>
> I've googled for this but come up empty...
>
> Thanks,
>
> Alex
>

agonzalez

2006-01-26, 9:57 pm

Sorry for not being clear, what I meant is I want to convert the UTC
time from the database into the users' current time zone.

Maybe an example is easier:

(UTC / GMT) of 1/1/2006 00:00:0000 is 12/31/2005 04:00:0000 on the west
coast of america (Los Angeles).

So I'd like CR to translate the UTC date into the users' local time
equivalent.

Does the above explain what I'm trying to do?

Thanks,

Alex

TomB. wrote:
> When you say 'convert the UTC format to the viewer's local time, do

you mean
> you only want the time stored to show or the local CurrentTime to show?
>
> To convert the UTC to show the time only, RightClick the field, Click on
> Format Field, Click the "Date and Time" tab, and select the format

that best[color=darkred]
> represents what you want to see.
>
> Sorry for not understanding "report viewers local time'.
>
> TomB.
>
> "agonzalez" wrote:
>
>
agonzalez

2006-01-26, 9:57 pm

Sorry for not being clear, what I meant is I want to convert the UTC
time from the database into the users' current time zone.

Maybe an example is easier:

(UTC / GMT) of 1/1/2006 00:00:0000 is 12/31/2005 04:00:0000 on the west
coast of america (Los Angeles).

So I'd like CR to translate the UTC date into the users' local time
equivalent.

Does the above explain what I'm trying to do?

Thanks,

Alex

TomB. wrote:
> When you say 'convert the UTC format to the viewer's local time, do

you mean
> you only want the time stored to show or the local CurrentTime to show?
>
> To convert the UTC to show the time only, RightClick the field, Click on
> Format Field, Click the "Date and Time" tab, and select the format

that best[color=darkred]
> represents what you want to see.
>
> Sorry for not understanding "report viewers local time'.
>
> TomB.
>
> "agonzalez" wrote:
>
>


TomB. wrote:[color=darkred]
> When you say 'convert the UTC format to the viewer's local time, do you mean
> you only want the time stored to show or the local CurrentTime to show?
>
> To convert the UTC to show the time only, RightClick the field, Click on
> Format Field, Click the "Date and Time" tab, and select the format that best
> represents what you want to see.
>
> Sorry for not understanding "report viewers local time'.
>
> TomB.
>
> "agonzalez" wrote:
>
>
ixm7

2006-01-29, 7:02 pm

If you have Crystal XI, you can use ShiftDateTime() to achieve this.

If you are using an earlier version of Crystal, my "CUT Light" UFL
provides a function for this.

Cheers,
- Ido
www.MilletSoftware.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com