The timezone block on register.inc.php (client include for account.php?do=create) renders the wrong time and appears not to be hooked into the database correctly at all. For example, it shows +8 hours for Pacific Time. Moreover, moving the toggle menu between different zones has no effect, it is not dynamic. No changes are seen.

Fortunately, the main system time on /scp/profile.php does work correctly so at least support tickets have the right timestamps. Rather than try to untie a big ugly knot of code, debug and rewrite what is essentially a purely cosmetic time display anyway on the registration page, I just replaced the errant code with this:

<input type="checkbox" name="dst" value="1" <?php echo $info['dst']?'checked="checked"':''; ?>>
<?php echo ('Observe daylight saving'); ?>
<em>(<?php echo
('Current Time'); ?>:
<strong><?php
// Return date/time info of a timestamp; then format the output
$today = date("D g:i A");
$convertedTime = date('D g:i A',strtotime('-2 hour',strtotime($today)));

echo $convertedTime;
?></strong>)</em>

Hopefully somebody else will find this useful. Cheers!

ntozier sorry, osTicket (v1.9.8.1)
The more I consider this non-functional 'Preferences' section, it doesn't even make sense to have it on the page. I tried to remove it from the <hr> block above, but the form wouldn't process. Next step is just to hide it using CSS.

    So if I get you right all you are saying is in your screen shot (of a user registering for an account) the text

    NaturalNine (Current Time: Tue 1:07 PM)

    is non dynamic and incorrect

    As a side note the 1.9.x is no longer supported.

      ntozier Yes. The original "Current Time" code is incorrect (+8 hours, which is why I posted the hack to at least show the right Pacific Time in the screenshot). Secondly, not sure what the point of the Preferences section is anyhow. As far as I can tell, there's nothing the client can do with that information. I don't see any field in user registration (i.e. client info card) for setting timezones so not sure why it's there in the first place on this form. Am I missing something?

      Write a Reply...