Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Date Formatting

Posted on 2002-06-05
3
Medium Priority
?
152 Views
Last Modified: 2010-04-04
Hi,

I wondered if anyone can tell me how to calculate the date 15 days from a date that has been calculated.

My code below works out the date 30 days from current.Monthly is a string value.

Monthly := (FormatDateTime('dd/mm/yyyy', Now + 30));

I want to work out what the date is 15 days prior to the above date and store it in a variable.
Can anyone help?

Many Thanks
0
Comment
Question by:HotRod40
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7055851
stringvar := (FormatDateTime('dd/mm/yyyy', yourdate - 15));

0
 

Author Comment

by:HotRod40
ID: 7055855
When I do this I get an error: 'Incompatible Types: String and Integer.
Any more ideas.
The code Im writing is this:

Prior:='FormatDateTime('dd/mm/yyyy', Monthly - 15));

Prior is a string.

Thanks
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7055859
yep,
your monthly-var you must reconvert to tdatetime before

look at strtodate

meikl ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question