close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DateTimeZone() and DateTime()

Thread begun 1/04/2023 7:33 pm by yogastudents362523 | Last modified 1/05/2023 10:48 am by Ray Borduin | 336 views | 1 replies |

yogastudents362523

DateTimeZone() and DateTime()

Hello,

Hope all is good.

Not an issue with your products.

In the example link I give in the private area, I would like to show the time of a Session as it wouod be in the Presenters location. All Sessions are in the America/Los_Angeles time zone, and so in PDT. But the location of Presenters varies. So if someone is in Italy, I would like the Session StartTime to be displayed as in the Europe/Rome time zone.

I can get things to workj using NOW. But I get constant errors when I try tio reac both the StartTime and the time zone from a database.

Thank you for any help.

Sign in to reply to this post

yogastudents362523

Hello,

I suddenly seem to have got this working.

<?php
$dt = new DateTime($rsFridayCombo->getColumnVal("StartTime"), new DateTimeZone('America/Los_Angeles'));
echo $dt->format('D M jS g:i a T') . "<br />";
$dt->setTimezone(new DateTimeZone(html_entity_decode( trim( $rsPresenters->getColumnVal("Timezone")))));
echo $dt->format('D M jS g:i a T') . "<br />";
?>

As you can see, I had to tame the database timezone value by stripping it and etc of extraneous junk.

That now for example prints out:

Fri Jan 20th 12:00 pm PST
Sat Jan 21st 7:00 am AEDT



Thank you.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...