473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

date periods?

Id like to be able to add text to my site but have it only saying that for a
couple of months. Is this easy to do?
Dec 22 '05 #1
2 1209
So you want to have some text displayed up until a specified date? If
so, this will do it:

<? if (mktime() < mktime (0,0,0,1,1,2006)) echo "hello"; ?>

If the current date is before the 1st Jan 2006, then show the text.
Otherwise don't.

Hope that helps,
Fred.

Dec 22 '05 #2
NC
Dave Turner wrote:

Id like to be able to add text to my site but have it only saying that
for a couple of months. Is this easy to do?


Yes. There are many ways of doing it. One example:

$date = 'February 22, 2006';
if (time() < strtotime($date)) {
echo "This is the text that should appear before $date";
} else {
echo "This is the text that should appear after $date";
}

Cheers,
NC

Dec 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Graeme Longman | last post by:
Hi everyone, I was wondering if anyone has written some Python code which uses a start date and end date and a given interval (day, month or year) and outputs all the time periods for that range...
2
by: Maksim Kasimov | last post by:
there are few of a time periods, for example: 2005-06-08 12:30 -> 2005-06-10 15:30, 2005-06-12 12:30 -> 2005-06-14 15:30 and there is some date and time value: 2005-06-11 12:30 what is the...
7
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone might be able to help me with the following issue: table ddl: create table exchange ( exchangefrom varchar(6), exchangeto varchar(6),...
7
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products...
14
by: Alan | last post by:
Hi everyone! I'm trying to produce a periodic financial report on projects from various departments. My database is set up with the tables tblDepartment, tblProjects, tblPeriods, and tblBudgets...
5
by: jnikle | last post by:
I have two completely unrelated tables, one for reviews and another for pay periods. The reviews table has a review date in it, and the pay periods table is just a list of the beginnings of pay...
1
by: lyntonS | last post by:
I need to create a Summary Report which shows the current 6 month periods values, in addition to the perious 6 months periods? Currently I have two separate queries. One I have built using...
10
by: kyosohma | last post by:
Hi, I am working on a timesheet application in which I need to to find the first pay period in a month that is entirely contained in that month to calculate vacation time. Below are some example...
1
by: guilhermelemmi | last post by:
I'm creating a function that will take a start date, a period duration (in months)and a maximum date, and will calculate the periods start and end dates until reaching the maximum date. For...
1
by: blondieUA | last post by:
Hello guys! I have some problem with creating the result page :( I need to create a web-page for my college course in Computer Science. I decided to create a site about Horoscopes. So if a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.