Questions tagged [zend-date]

The tag has no usage guidance.

zend-date
Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

How do I find out if current Zend_Date time is between time today and time tomorrow?

Hello I am using $currentDate = new Zend_Date(); to get the current time but I need to determine if that time is between say 10pm and 2am - how can I do this with Zend_Date, the next day part is what ...
Pippy Longstocking's user avatar
0 votes
1 answer
70 views

EndDate Issue - Last Month of Year

I have a .netapp application (C#) that I use to extract data from an API. It is having a problem just now as we are running this for December 2017.. but we want it to name as January 2018. (well 01/...
craig157's user avatar
  • 365
1 vote
2 answers
1k views

class Zend_Date not found

I googled a lot until now, but I couldn't find anything that works. I need to save a proper datetime value in my mySQL database, so I tried as used in ZF1 this one: $date = new Zend_Date(); echo $...
pia-sophie's user avatar
0 votes
1 answer
159 views

Location of Zend_Date PHP class

I'm trying to use the Zend_Date class for my project. I'm working with the PHP Storm IDE and I've searched throughout the ZF2 folder which is included in my project under the: /vendor/ZF2/library/...
perkes456's user avatar
  • 1,171
0 votes
0 answers
597 views

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 = ...
Alessandro Staffolani's user avatar
0 votes
1 answer
647 views

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 { ...
Murilo's user avatar
  • 640
2 votes
1 answer
7k views

Get localized Month Name in Concat function from query MySQL

In the db table 'items' I have a column 'date' (type date). In my query I want to build a string from a couple of columns including this date column, but I want the date to be displayed as month name ...
zef's user avatar
  • 649
0 votes
1 answer
768 views

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 ...
Amina's user avatar
  • 672
0 votes
4 answers
332 views

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 ...
Sonu Jha's user avatar
  • 719
1 vote
2 answers
213 views

Get the date from a time string

Is there a way to convert an input time string (ex: 01:13) to a Zend date object, so that I store it later in a timestamp column in a Mysql database. Examples: If the current datetime is 2013-07-15 ...
Songo's user avatar
  • 5,688
4 votes
2 answers
4k views

Check valid date in zend framework

I am using zend framework 1.12.0 and i have a value fetching from database to be validated. That is if its a date value then i have to change the format into YYYY-MM-DD to MM/DD/YYYY.Else i keep the ...
웃웃웃웃웃's user avatar
0 votes
1 answer
95 views

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 ...
Michelangelo's user avatar
  • 1,397
1 vote
1 answer
895 views

Strange error in the Zend_Date localization

I have two problems in my little script. I am trying to create an application that use Zend Framework 1.12.1, Doctrine, Zend_locale, Zend_Currency and Zend_Date. Dates: The database needs a date in ...
Michelangelo's user avatar
  • 1,397
0 votes
1 answer
726 views

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: ...
Tomasz Rozmus's user avatar
0 votes
1 answer
458 views

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, ...
freento's user avatar
  • 2,959
1 vote
1 answer
212 views

Is it possible to set Zend_Date options in application.ini config?

Is it possible to set Zend_Date options in application.ini config like this: resources.date.options.format_type = php in Zend Framework v 1.* ?
avasin's user avatar
  • 9,436
0 votes
1 answer
2k views

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 ...
masteryoda's user avatar
1 vote
2 answers
434 views

Zend_Date() is not giving the correct/expected result

Zend_Date function returns the value "Feb 10, 2012" . It supposed to return "Oct 2, 2012". If a give the day greater than 12 than it returns the currect output. I don't know what I was missing. ...
user1559230's user avatar
  • 2,781
1 vote
1 answer
601 views

How to use an abbreviated month with Zend_Date and locale formatting

I'm trying to set a long date format with an abbreviated month that uses the locale of the user. Here's what I have now. //getDateTimeObject('field') grabs a Zend_Date object of the field $...
Bryan Phillips's user avatar
0 votes
1 answer
321 views

Split time by day of the week with an interval defined by two Zend_Date

I have two Zend_Date that represent an interval : $start = new Zend_Date($punch->getStart()); $end = new Zend_Date($punch->getEnd()); $nbHours = $start->sub($end , Zend_Date::HOUR); $...
Jean-Philippe Bond's user avatar
0 votes
1 answer
448 views

How i can get internationalized date string from Zend_Date without time

I need to echo internationalized time in different format for different languages. Now i am using locale when creating a date, but it also outputs time: $date->toString(); 29.05.2012 0:00:00 ...
avasin's user avatar
  • 9,436
0 votes
1 answer
659 views

Zend_Date::sub() and ISO_8601 calculating hour difference wrong

I want to calculate time difference between two Zend_Date objects (for countdown calculator): $now = new Zend_Date($now_datetime, Zend_Date::ISO_8601); $end= new Zend_Date($end_datetime, Zend_Date::...
Tomasz Rozmus's user avatar
4 votes
2 answers
553 views

Zend_Date: wrong results on DST change day

"25 Mar 2012" was the date when time was changed from 02:00am to 03:00am in the Czech Republic. On that date, one functionality on my website stopped working correctly and a customer complained, etc. ...
clime's user avatar
  • 8,825
0 votes
1 answer
623 views

populating hours/dates into a Zend_Form_Element_Select

I'm looking for Zend_Form elements which will allow me to integrate Zend_Date values easily. For example, I need a hour picker and a week day picker in my forms. for example, the hour picker should ...
aporat's user avatar
  • 5,932
0 votes
1 answer
2k views

convert date to a different format

I have a date of the form mm-dd-yyyy. I need to convert into YYYY-MM-dd to store in the database. I did the following $eff_date=$this->post['effective_date']; $eff_date=$eff_date->toString('...
newbie's user avatar
  • 1,021
2 votes
1 answer
601 views

Zend_Date not working it seems

I have been working with Zend_Date. Can anyone tell me if the behaviour below is normal? The returned months seem to be wrong. I have put the output in comments. Thanks for any help! $oDate = new ...
Rupert's user avatar
  • 1,629
-2 votes
1 answer
545 views

Zend_Date subtraction of two datetime mysql values

i am building a small application to calculate employee attendance. A user will check in, his check in time will be recorded in a mysql datetime format, for example check_in_time 2011-12-16 20:27:20 ...
zf.'s user avatar
  • 123
5 votes
1 answer
9k views

How to compare the date parts of two Zend_Date objects?

I'd like to check if to Zend_Date datetimes are on the same day. How can I do that? $date1 = new Zend_Date('2011-11-14 10:45:00'); $date2 = new Zend_Date('2011-11-14 19:15:00');
BenMorel's user avatar
  • 35.5k
3 votes
3 answers
2k views

Bug with Zend_Date calculating subtraction two date

I write this function: public function calcDifferentDate($dateStart, $dateEnd = false, $output = Zend_Date::DAY) { $dateEnd = $dateEnd ? $dateEnd : Zend_Date::now()->toString('YYYY-MM-dd'); ...
JellyBelly's user avatar
  • 2,431
0 votes
2 answers
3k views

Calculating difference between 2 Zend_Date objects

I have 2 Zend_Date objects: $d1 = new Zend_Date('2011-11-14 12:20:30'); $d2 = new Zend_Date('2012-11-16 13:40:10'); And I need to calculate difference. My output should be like this: Years: 1, ...
Alex Pliutau's user avatar
  • 21.6k
3 votes
1 answer
2k views

First day of each month

If I start with the current date, how can I get the first Friday of each month? I was thinking about using $date->get(Zend::WEEKDAY) and comparing that to Friday and then with DAY and checking if it ...
Sam French's user avatar
2 votes
3 answers
3k views

Saving a Zend date in the database with Doctrine 2.1

I want to save a datetime in the database which was created with the doctrine schema tool. In my form I set a date and time and i want to save it as a datetime in the database. So i tried this: $e-&...
sanders's user avatar
  • 10.7k
1 vote
1 answer
342 views

Zend_Date adding the timezone to a subtraction result

I have this code: <?php $start = new Zend_Date("2011-09-06T10:00:00+02:00",Zend_Date::ISO_8601); $end = new Zend_Date("2011-09-06T10:01:00+02:00",Zend_Date::ISO_8601); echo $end->...
mingos's user avatar
  • 24.1k
3 votes
1 answer
1k views

Work Around for Zend Date DST Bug

I discovered a bug in Zend_Date when setting a time that crosses the DST change. Here's code that illustrates the problem: date_default_timezone_set('America/New_York'); echo '<pre>'; // DST ...
Sonny's user avatar
  • 8,296
3 votes
1 answer
1k views

Zend Jalali Date

Does Zend support jalali date and calendar? And How can i get that ? I tried this: $locale = new Zend_Locale('fa_IR'); $date = new Zend_Date(); $new_date= Zend_Locale_Format::...
‌‌R‌‌‌.'s user avatar
1 vote
1 answer
120 views

Should dates and currencies always be passed around as objects?

Help me settle an argument with a coworker... We’re using Zend Framework and PHP and much of the data we deal with includes dates and prices. I’ve been arguing that when the data is retrieved (either ...
J Cobb's user avatar
  • 294
2 votes
2 answers
2k views

Zend_Date tooooooooo slow, real slow

This is my code: $frontendOptions = array('lifeTime' => 10); $backendOptions = array('cacheDir' => '../tmp/'); $cache = Zend_Cache::factory( 'Core', 'File'...
iVela's user avatar
  • 1,160
14 votes
6 answers
47k views

PHP Zend date format

I want to input a timestamp in below format to the database. yyyy-mm-dd hh:mm:ss How can I get in above format? When I use $date = new Zend_Date(); it returns month dd, yyyy hh:mm:ss PM I also ...
maniclorn's user avatar
  • 1,091
1 vote
1 answer
348 views

zend date and summertime

I have a issue with dates crossing from winter/summer time.. please see example $pickUpDate = '2011-10-23'; $dropOffDate = '2011-10-31'; $pickUpTime = '09:00'; $...
Xrender's user avatar
  • 1,435
1 vote
1 answer
837 views

zend-framework how to Localize Zend_Date

how to localize the Zend_Date when i wrote Zend_Debug::dump(Zend_Locale::getTranslationList('type', 'en_US')); i got long array some of its elements . . ["hebrew"] => string(15) "Hebrew ...
ahmedsafan86's user avatar
  • 1,774
2 votes
3 answers
3k views

Zend_Date / Zend_Locale : Change date format for a specific locale?

Is it possible to instruct Zend_Locale that it should use a certain locale, except for a minor alteration to the date format? I don't want to use the Zend_Date::toString() with the specific ...
kander's user avatar
  • 4,256
1 vote
1 answer
2k views

Zend_Date::isDate won't enforce $format

I've having an issue where Zend_Date::isDate is returning true even when the value doesn't necessarily match the format given. For example: $time = "12:34:56"; // Time doesn't have AM/PM attached ...
Ryan's user avatar
  • 17.8k
0 votes
2 answers
147 views

Zend Date giving me zeroes, why?

More problems with dates. Basically I'm trying to populate a table with some datetime values from Zend. The datatype of the column that I'm trying to populate is 'datetime'. However, no matter which ...
Fortisimo's user avatar
  • 1,002
5 votes
2 answers
2k views

Bug in Zend_Date (back in time)

I have a very strange problem, Zend_Date is converting my timestamp to a year earlier. In my action: // Timestamp $intTime = 1293922800; // Zend_Date object $objZendDate = new Zend_Date($intTime); ...
Jeroen Weustink's user avatar
0 votes
1 answer
133 views

Zend_Date returning strange format online - works fine on my localhost

I have the following code to format dates: $date = new Zend_Date(); $date->set(strtotime($some_date); echo ($date->get(Zend_Date::DATE_FULL)); it wokrs fine on my localhost outputting the date ...
Ali's user avatar
  • 7,433
0 votes
4 answers
286 views

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?...
Sonny's user avatar
  • 8,296
3 votes
3 answers
2k views

How can I simply change the Timezone Offset with Zend_Date?

I'm using Zend_Date to manage dates/times in a scheduling app. The only way I'm able to determine the user's Timezone is via Javascript which only gives a Timezone Offset. Zend_Date only seems to ...
Nicky Hajal's user avatar
  • 1,624
9 votes
6 answers
21k views

Zend Date -- day difference

I have the below line of codes $day1 = new Zend_Date('2010-03-01', 'YYYY-mm-dd'); $day2 = new Zend_Date('2010-03-05', 'YYYY-mm-dd'); $dateDiff = $day2->getDate()->get(Zend_Date::TIMESTAMP) - $...
Nisanth Kumar's user avatar
1 vote
1 answer
2k views

Zend_Date and setting timezone on instation

I have a ZF app and am saving times as UTC in MySQL db. When I retrieve, them I'd like to tell Zend_Ddate that they are UTC rather than the timezone set in php.ini of 'America/Los Angeles'. Currently,...
timpone's user avatar
  • 19.6k
0 votes
3 answers
2k views

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. ...
flufferok's user avatar