otuatail Posted November 2, 2006 Share Posted November 2, 2006 Hi. The time function does not take any argument = int time ( void )I need to get a stamp value for specific dates and tomes like$stamp1 = time();$stamp2 = time("1-1-2000");Is there a function that can achive this please.Desmond. Link to comment https://forums.phpfreaks.com/topic/25909-specific-unix-date-stamp/ Share on other sites More sharing options...
gmwebs Posted November 2, 2006 Share Posted November 2, 2006 You could try and use [code=php:0]strtotime()[/code] which will convert a string representation of a date to a unix timestamp.[code]<?php$stamp1 = time();$stamp2 = strtotime("1 January 2000");?>[/code] Link to comment https://forums.phpfreaks.com/topic/25909-specific-unix-date-stamp/#findComment-118323 Share on other sites More sharing options...
heckenschutze Posted November 2, 2006 Share Posted November 2, 2006 [quote]mktime -- Get Unix timestamp for a dateDescriptionint mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )[/quote][code]<?phpecho mktime(0, 0, 0, 12, 32, 1997); /* example timestamp for 32/12/1997 */?>[/code]hth :) Link to comment https://forums.phpfreaks.com/topic/25909-specific-unix-date-stamp/#findComment-118325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.