Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. //The variable container name is $date
  2. //----------------------------------------------------------------------------------------------
  3. //the placeholder <$BBD> refers to the variable of the best before date field in the spoolfile
  4. $d = <$BBD>
  5. $day = substr($d,1,2);
  6. $mon = substr($d,3,2);
  7. $year = substr($d,5,2);
  8. log(1, "$day" + $day);
  9. log(1, "$mon" + $mon);
  10. log(1, "$year" + $year);
  11.  
  12. if ($mon = "01") {
  13. $montext = "Jan";
  14. }
  15. else if ($mon = "02") {
  16. $montext = "Feb";
  17. }
  18. else if ($mon = "03") {
  19. $montext = "Mar";
  20. }
  21. else if ($mon = "04") {
  22. $montext = "April";
  23. }
  24. else if ($mon = "05") {
  25. $montext = "May";
  26. }
  27. else if ($mon = "06") {
  28. $montext = "June";
  29. }
  30. else if ($mon = "07") {
  31. $montext = "July";
  32. }
  33. else if ($mon = "08") {
  34. $montext = "Aug";
  35. }
  36. else if ($mon = "09") {
  37. $montext = "Sept";
  38. }
  39. else if ($mon = "10") {
  40. $montext = "Oct";
  41. }
  42. else if ($mon = "11") {
  43. $montext = "Nov";
  44. }
  45. else if ($mon = "12") {
  46. $montext = "Dec";
  47. }
  48. //the placeholder <$country> refers to the variable of the country field in the spoolfile
  49. //i.e. If the Customer is US-based then certain format will be outputted
  50. if (<$country> = "US") {
  51. $date = $montext + " " + $day + " " + "20" + $Year;
  52. }
  53. else {
  54. $date = $day + " " + $montext + " " + "20" + $Year;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement