Jump to content

Date Time Format in nusoap.php


barryjenkins

Recommended Posts

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,

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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()));

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.