08-12-2003
Try loading the data into a giant multi-dimensional array and using one of the (associative?) array sorting functions rearrange the data. To set the displayed date back a week, subtract the number of seconds in a week from the timestamp, if you're using an epoch format dts in the db. then use getdate("whatever", ($array[id][date] - $num_seconds)); to display it.
Your post is worded rather confusingly. Could you please rephrase it? I don't think I'm quite getting the gist of what you're saying.
10 More Discussions You Might Find Interesting
1. Solaris
Hi Friends,
Can any one guide me regarding 'Display the date and time' command other than the command 'date'
thanks n regards
SsRrIi (1 Reply)
Discussion started by: SsRrIi
1 Replies
2. Shell Programming and Scripting
Hello,
Is there any easy way to write a script to display the date for the previous day? I have a script which queries a sybase database, and pull the data for certain time period. I'd like to know how you can get the day for previous day, something like: date - 1!
Thanks,
Frank (2 Replies)
Discussion started by: FrankC
2 Replies
3. Shell Programming and Scripting
I have write
echo `date +%y%m%d`
but it will give
070529.
why I am not getting 070530.
I have Make any syntactical error?
please help. (2 Replies)
Discussion started by: rinku
2 Replies
4. Shell Programming and Scripting
Hi buddies,
I have a doubt. I want to display filename with date in the following format.Is there any way to do this. Kindly give me the solution.
I want to display the result in the following manner.
test1.txt 03/28/2008
testlog.log 02/20/2008
Please let me know one solution how to do... (1 Reply)
Discussion started by: pstanand
1 Replies
5. Shell Programming and Scripting
Hi Unix Gurus,
I have a script which runs vmstat and puts the output to a file.
I am pulling the runq,usr,sys,idle columns using awk
vmstat 2|awk {'print $1,$14,$15,$16'}
Now within this command is there any way i can pass the date too.
Please do let me know.
Thanks in advance.
Arun (5 Replies)
Discussion started by: arunrao_oradba
5 Replies
6. UNIX for Dummies Questions & Answers
Hi,
How to display particular date's files in Unix?
e.g. I want to display april 30th 2009 files only.
Regards,
Venkatesh. (3 Replies)
Discussion started by: venkatesht
3 Replies
7. UNIX for Dummies Questions & Answers
Hi i am currently using below command in shell script and calling it from cron job.
This is to take daily backup with the date as suffix to the file.When i try i unable to get the date suffixed to the backup file.
Please help me as to wt's wrong in this or how to get the date added to the... (5 Replies)
Discussion started by: abhi_n123
5 Replies
8. Shell Programming and Scripting
Well guys,
I know the right syntax for displaying the current date is $(date). However, I am planning to send emails to some customers which displays their subscription date, and then the expiry. The expiry being 30 days from the current date.
What would the right syntax be? (6 Replies)
Discussion started by: xxxx
6 Replies
9. Shell Programming and Scripting
Hi, i am very new to php Is it possible to display Range of date depend on user input day
example:
user input 2 day start from 28/4/12 it will add 2 day from date of input
so display should look like this
28/4/12 to 30/4/12
then from 30/412 user add another 4 date so will... (0 Replies)
Discussion started by: guidely
0 Replies
10. HP-UX
Hi,
I have one hp-ux sytem date display problem when viewed remotely
hostA 21: date
Fri Jul 5 11:18:51 SST 2013
hostA 22: remsh hostB -l username -n date
2013年07月05日 11時32分27秒
But on actual system it display correctly:confused:
hostB 21: date
Fri Jul 5 11:40:33 SST 2013 (4 Replies)
Discussion started by: jorendain
4 Replies
LEARN ABOUT PHP
datetime.settimestamp
DATETIME.SETTIMESTAMP(3) 1 DATETIME.SETTIMESTAMP(3)
DateTime::setTimestamp - Sets the date and time based on an Unix timestamp
Object oriented style
SYNOPSIS
public DateTime DateTime::setTimestamp (int $unixtimestamp)
DESCRIPTION
Procedural style
DateTime date_timestamp_set (DateTime $object, int $unixtimestamp)
Sets the date and time based on an Unix timestamp.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $unixtimestamp
- Unix timestamp representing the date.
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
EXAMPLES
Example #1
DateTime.setTimestamp(3) example
Object oriented style
<?php
$date = new DateTime();
echo $date->format('U = Y-m-d H:i:s') . "
";
$date->setTimestamp(1171502725);
echo $date->format('U = Y-m-d H:i:s') . "
";
?>
Procedural style
<?php
$date = date_create();
echo date_format($date, 'U = Y-m-d H:i:s') . "
";
date_timestamp_set($date, 1171502725);
echo date_format($date, 'U = Y-m-d H:i:s') . "
";
?>
The above examples will output something similar to:
1272508903 = 2010-04-28 22:41:43
1171502725 = 2007-02-14 20:25:25
NOTES
Using the Unix timestamp format to construct a new DateTime object is an alternative when using PHP 5.2, as shown in the example below.
Example #2
DateTime.setTimestamp(3) alternative in PHP 5.2
<?php
$ts = 1171502725;
$date = new DateTime("@$ts");
echo $date->format('U = Y-m-d H:i:s') . "
";
?>
The above example will output something similar to:
1171502725 = 2007-02-14 20:25:25
SEE ALSO
DateTime.getTimestamp(3).
PHP Documentation Group DATETIME.SETTIMESTAMP(3)