This code gets the date difference manually, specifying a date value.

$digest_date = "2009-12-25";
$date_diff = abs(strtotime(date('y-m-d'))-strtotime($digest_date)) / 86400;

and another version in a method if you want to keep on reusing this code.

function dateDiff($dformat, $endDate, $beginDate) {
  $date_parts1=explode($dformat, $beginDate);
  $date_parts2=explode($dformat, $endDate);
  $start_date=gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]);
  $end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]);
  return $end_date - $start_date;
}

Transition from Windows to Mac OS is pretty hard. It wasn’t easy for me at first considering I’ve been used to using Windows for more than a decade now. Both do have standard keyboard shortcuts but the symbols that Mac uses is kinda different.

The sequence of symbols in a shortcut means that these keys should all be pressed in order to have the desired action be invoked. This does not mean though, that for example a shortcut needs 3 key buttons, you would need to have 3 key buttons pressed at the same time.

You can either press 1 of them first, then the 2nd (while still having the 1st key pressed), then the 3rd. The same way you do with 2 key button shortcuts under Windows. Here is a small guide for you noobs out there.

In Android m5 rc15, nested XML is not possible. Google should have included this feature because it is very useful. You don’t have to clutter your layouts inside 1 XML file. As with other web programming languages where you can do includes, Android doesn’t have it. So far, there has been no workaround made. I came upon one person who gave a solution but somehow it didn’t work. I always have this “layout_width must be set” problem. You can however load XML layouts at runtime using the ViewInflate class. But you need to have layout tags in your XML files and retrieve them via your code. For a quick sample, I had a separate article regarding this.

Click here.

Related Posts Plugin for WordPress, Blogger...