barryjenkins Posted December 19, 2011 Share Posted December 19, 2011 Hi, I have noticed on my print order section in my cart that the date/time is in US format ie. there is an entry that calls up "date_purchased" and places this in the following format %Y-%m-%d %H:%M:%S I have searched all the text in my online shop and I have located the code i believe is responsible under \includes\classes\nusoap.php This is in the following entry return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec); My question is can i change this code to either of the following without causing any damage else where in the site? I am not sure if it needs the %H:%M:%S', $sec entry here for anything??? Can i do.. return strftime ('%d-%m-%Y %H:%M:%S', $sec) or return strftime ('%d-%m-%Y ) without it causing issues in the code? Many Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/ Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Without knowing what the function does or what uses the function, we can't really tell you for sure. If something is depending on that function giving that specific date format then yeah, you might botch it up. Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299193 Share on other sites More sharing options...
barryjenkins Posted December 19, 2011 Author Share Posted December 19, 2011 Thanks scootstah, All i need to do is changed the format of the date in the printorder.php under the root that emails the customer. As mentioned there is a "date_purchased" entry and this places this in the following format %Y-%m-%d %H:%M:%S all i want to is display %d-%m-%Y and i don't know how else to skin the cat? My settings in the admin GUI are for UK. Am i skinning the wrong cat or so you have any other ideas how i can do this? Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299197 Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Well you asked if the change would possibly effect other code. The answer is, we can't tell you. Like I said, something might be depending on a date in that specific format. If you only need it in one location and you don't want to change that function, just reformat it for that page. $date = date('d-m-Y', strtotime(theFunction())); Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299203 Share on other sites More sharing options...
barryjenkins Posted December 19, 2011 Author Share Posted December 19, 2011 Thanks will give this a shot. The code is listed below from the print order. <tr> <td class="main"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . $order->info['date_purchased']; ?></td> </tr> <tr> <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2"> So would that mean that something like the following may work? <tr> <tr>$date = date('d-m-Y', strtotime("date_purchased"())); <td class="main"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . $order->info['date_purchased']; ?></td> </tr> <tr> <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2"> Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299204 Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Try this: <tr> <tr> <td class="main"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . date('d-m-Y', strtotime($order->info['date_purchased'])); ?></td> </tr> <tr> <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2"> Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299206 Share on other sites More sharing options...
barryjenkins Posted December 19, 2011 Author Share Posted December 19, 2011 YOU ARE A LEGEND!!!!! Worked a treat!!! Let me buy you a beer if i see you in a pub!!!! THANKS!!!!!!!!!!!!!!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299218 Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 I'm a long walk from the UK. But that's okay. Enjoy. Quote Link to comment https://forums.phpfreaks.com/topic/253458-date-time-format-in-nusoapphp/#findComment-1299220 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.