Jump to content
Sign in to follow this  
dwhoover

UPS XML Displayed Date Format

Recommended Posts

I'm trying to change the date format displayed on the Delivery Information and subsequent pages. It is currently "2005-09-19"...I would like it to read "09-19-2005".

 

Can anyone share a fix for this?

 

Thanks! :thumbsup:


osCommerce MS2

SPPC incl. Specials By Category, Prices By Category

Vendors, Easy Populate, UPS XML, USPS Methods

Share this post


Link to post
Share on other sites
I'm trying to change the date format displayed on the Delivery Information and subsequent pages.  It is currently "2005-09-19"...I would like it to read "09-19-2005".
Actually, directions for things like that are already in the catalog/includes/modules/shipping/upsxml.php file (around line 250):

  // instead of just adding the expected delivery date as ", yyyy-mm-dd"
 // you might like to change this to your own liking for example by commenting the
 // three lines above this and uncommenting/changing the next:
 // START doing things differently

 

In this case you would have to simplify the given example to (untested):

   	 if (isset($this->servicesTimeintransit[$type])) {
  	 $eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
  	 $eta_arrival_date = $eta_array[2]."-".$eta_array[1]."-".$eta_array[0];
   $_type = $_type . ", " . $eta_arrival_date;
   }

Share this post


Link to post
Share on other sites

JanZ:

 

Sorry about the duplicate post. I'm just getting used to posting and replies!

 

Thanks for the info, and yes, I should have RTFM (or, in this case, RTFC).

 

Cheers!

 

 

 

Actually, directions for things like that are already in the catalog/includes/modules/shipping/upsxml.php file (around line 250):

 ?// instead of just adding the expected delivery date as ", yyyy-mm-dd"
?// you might like to change this to your own liking for example by commenting the
?// three lines above this and uncommenting/changing the next:
?// START doing things differently

 

In this case you would have to simplify the given example to (untested):

 ? ?	if (isset($this->servicesTimeintransit[$type])) {
? ?	$eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
? ?	$eta_arrival_date = $eta_array[2]."-".$eta_array[1]."-".$eta_array[0];
? ?$_type = $_type . ", " . $eta_arrival_date;
? ?}


osCommerce MS2

SPPC incl. Specials By Category, Prices By Category

Vendors, Easy Populate, UPS XML, USPS Methods

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×