Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Date format



  Convert time to Unix time

Unix time is defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), 1 January 1970,not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line. Sometimes it's a bit difficult to compare times stored in different applications or systems with ...

   UNIX time, Oracle DATE, conversion, timestamp     2013-01-19 09:04:17

  Using DateInterval class in PHP

DateInterval is (amongst others) a relatively new addition to the date extension in PHP 5.3. It allows to describe an interval in time, and you can perform actions with that interval. Basically, it allows to calculate with dates in a very easy way, and do even more fun stuff with it.Unfortunately no documentation exists today for DateInterval and friends, but PHP is open-source so you can easily have a peek at the code to see what’s happening under the engine. This is more or less what th...

   PHP,DateInterval,Class,PHP 5.3,Demo     2011-10-21 10:35:54

  Date interval add and sub prior to PHP 5.3

After PHP 5.3, we can use DateInterval object or date_interval_create_from_date_string() function to add or subtract days,weeks,months or years to or from a DateObject.But prior to PHP 5.3,we cannot do this. If we want to achieve the same effect. We need to use some skills. Here is one:We can use strtotime() function to achieve this. For example:$date=date('Y-m-d',time());$datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1 day'); $datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1...

   PHP,DateInterval,Class,PHP 5.3,PHP 5.2     2011-10-21 10:50:10

  Dates in PHP and MySQL

I see a lot of people on forums and on my training courses asking about the best way (or any way) to manage dates stored in a MySQL database and used in PHP. Three options follow, but first the problem.PHP uses unix timestamps for all its date functionality. It has methods to convert these timestamps into pretty much any text format you could want but internally it uses the timestamp format. A timestamp is simply an integer. Specifically, it’s the number of seconds that have ela...

   PHP,MySQL,Date format,Date,Comparison,Date compare     2011-10-17 14:00:57

  The confusing strtotime() function in PHP

Frequently PHP programmers get confused of the use of i month, -1 month, next month in strtotime() function. and hence it leaves some impression to programmer that this function is not that reliable. Let's take one example of strtotime call with -1 month and see why it leaves this impression. date("Y-m-d",strtotime("-1 month"))  // Assume today is 2018-07-31 What's the output of above call? The answer is 2018-07-01. Why not 2018-06-30? So people get confused. It appears that this is ...

   PHP,STRTOTIME,FIRST DAY OF,-1 MONTH     2018-08-04 05:49:32

  How to Convert Images on Mac Finder

If you have a lot of images in different formats and you want to convert them to a common format, you can use the Mac Finder to do it easily and quickly. Here are the steps to follow: 1. Open the Finder and navigate to the folder where your images are stored. 2. Select the images that you want to convert. You can use the Shift key or the Command key to select multiple images at once. 3. Right-click on the selected images and choose Services > Preview from the context menu. This will open the ...

   MACOS,FINDER,IMAGE CONVERSION     2023-04-16 02:09:54

  Windows 8.1 will be released on October 18

According to TheVerge, Microsoft Windows 8.1 will be released on October 18. Windows 8 users can download the free update on Windows Store one day before the release date, There will be a formal release press on October 18. In next few weeks, Windows 8 RTM will be open to PC manufacturers and partners. In this year's WPC, Microsoft demonstrated their latest Windows 8.1 on various devices most of the time, including the 8-inch Tablet PC, laptops, desktops and even streamed content from PC to Xbo...

   Windows 8.1,Release date     2013-08-14 11:49:09

  Use of @font-face

Almost all web browsers(including the dinosaur browser IE6) support the web font property @font-face. Its usage is: @font-face { font-family: 'MyWebFont'; src: url('webfont.eot'); /* IE9 Compat Modes */ src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('webfont.woff') format('woff'), /* Modern Browsers */ url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */ url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ } Now we...

   CSS,@font-face     2014-06-08 07:17:34

  Format JSON data on Ubuntu

JSON now becomes a very popular data format because of its simplicity and light-weight. Nowadays many RESTful APIs will offer a choice of exchanging JSON data between the server and client. Sometimes the data may not be formatted and it cannot be easily read by human beings. It's frequently desired that the unformatted JSON data should be formatted before read. Today we will show a few ways to format JSON data on Ubuntu. Assume we have a json file test.json with below content. { "title": "Test"...

   RUBY,PYTHON,NODEJS,JSON,JQ,PERL,LINUX,UBUNTU,YAJL     2016-08-17 11:05:09

  Read white space with scanf()

Usually, when we want to enter string with white spaces in C, we need to call gets() or fgets(0 method. We usually will not use scanf(0 or fscanf() because they cannot accept white spaces when scan user inputs.   But when we specify the format in scanf() function, we may read strings with white space. the code section below illustrate this: #include <stdio.h>   int main(int argc,char **argv){        char name[30];      fprintf(stdout,"Please en...

   C,scanf,white space, string format     2011-09-26 11:45:43