Questions tagged [zend-date]

64 questions
0
votes
4 answers

Zend Date Weirdness - Missing Configuration?

I'm getting odd output from the getDate() function. It's supposed to return a date without the time parts, but I am getting time parts. Am I missing some configuration option that would correct this? Sample…
Sonny
  • 8,204
  • 7
  • 63
  • 134
0
votes
0 answers

Zend Date how to check if date is between two given dates

I'm trying to compare a date, I have two given dates, and I want to know if current date is between these given dates. here my function private function isDateDiscount($start, $end) { $start = new Zend_Date($start); $end = new…
0
votes
1 answer

Zend_Date addMonth adding more then parameter

So, I have the code as it follows: $dateBase = $amount->getDate(); for ($i = 1; $i <= 3; $i++) { $installment = new Installment(); if ($i == 1) { //do stuff } else { var_dump('1-'.$dateBase->toString()); …
Murilo
  • 580
  • 5
  • 21
0
votes
3 answers

zend_date relative time

i want to make stackoverflow timestamps(X minutes ago, etc). How i can make it using zend_date? I found How to calculate time passed with PHP or Zend_Date? this realisation, but it uses other library. Are there any different ways?
flufferok
  • 1
  • 2
0
votes
1 answer

Filtering table rows with higher date than provided

I'm currently trying to do it that way: // Creating date object $date = new Zend_Date(); // Adding to it 4 weeks $date->add('4', Zend_Date::WEEK); // it's expire day // Getting date in integer(i guess it's unix timestamp…
Somebody
  • 9,316
  • 26
  • 94
  • 142
0
votes
1 answer

Zend_Date language translation

I have a function that returns me a date string using Zend_Date. $date = new Zend_Date(); $date->setOptions(array('format_type' => 'php')); $date->setTimestamp($timestamp); return $date->toString($format); When I set $format to 'l, d F Y' I expect…
hsz
  • 148,279
  • 62
  • 259
  • 315
0
votes
1 answer

Internationalized date formatting with Zend_Date ( Japanese )

Disclaimer: you might need to install a font/typeface which supports Japanese if you see messed up characters. I'm trying to replicate what I've been doing so far with setlocale and strftime: setlocale(LC_ALL, 'ja_JP.utf8'); $time =…
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
0
votes
1 answer

How to get current and local time with Zend Framework?

In my App i have to get my local time ,I used this code : $date = new Zend_Date(); $time = $date->get(Zend_Date::TIME_LONG); But it gives me 7:51:00 AM UTC ,UTC time . Can someone help me to get my local time. Thanks.
Amina
  • 682
  • 3
  • 9
  • 23
0
votes
4 answers

formatting date and time in php for sql insertion

I have a date, and a time, which I parse from a csv file, $date being a string, and it holds the value '18-06-2013', and the $time string var holds the value '06.00'. I need it formatted by php so that I can insert it into my mysql database in the…
Sonu Jha
  • 719
  • 3
  • 13
  • 23
0
votes
3 answers

How to calculate time passed with PHP or Zend_Date?

I'm trying to create a view helper that will display the number of minutes, hours, or days that have passed since...right now. I'm not really sure how to do it. It looks like the date comparison is working, but I don't know how to get the number.…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
2 answers

formatting date from twitter response Zend Framework

im trying to formatting the date field 'created_at' from Twitter API response with Zend_Date. I want output the date like this: 21 of July of 2009, 12:30:00 (for example) What format is this?: Fri Oct 23 15:47:42 +0000 2009 thanks a lot
returnvoid
  • 434
  • 1
  • 7
  • 19
0
votes
1 answer

Strange behaviour of Zend_Date

I have this situation: $date = new Zend_Date(); $date->toString(Zend_Date::DATE_MEDIUM); With 'it' locale this code outputs (e.g 04/mar/2013) instead of a dd/MM/yyyy format With 'en' locale it outputs (e.g. Mar 4, 2013) instead of a MM/dd/yyyy…
Michelangelo
  • 1,398
  • 2
  • 14
  • 37
0
votes
1 answer

Zend_Date, ISO_8601, date parsing and local system clock

I have a strange problem with Zend_Date object. It seems that setters perform different operations with different system clock dates. Let's assume that system date is 28 January 2013, following code: $now=new…
Tomasz Rozmus
  • 1,646
  • 13
  • 21
0
votes
1 answer

Get date of nearest certain day of week

I'm using Zend_Date to create dates. How can I get date of the nearest further day of week, Monday, for example. I need to calculate it not only from now, but from any date. Example. January, 31, Thursday. I need to calculate date of the nearest…
freento
  • 2,939
  • 4
  • 29
  • 53
0
votes
1 answer

Zend_Date compare two dates

I have two dates given as Zend_Date(). I must check the following: if theese dates are in the same month day (for example: second day of the month, year does not matter), if dates are from exactly the same day(for example 2 december 2012);
masteryoda
  • 272
  • 2
  • 20