473,465 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding Two times to change current date

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $timezone = "Asia/Calcutta";
  3. if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
  4. echo date('d/m/Y H:i:s A');
  5.  //echo $date = date("Y/m/d H:i:s");echo "\n";
  6.  
  7. $original=time($timezone);
  8. if(isset($_POST['btn']))
  9. {
  10. $hr=$_POST['hour'];
  11. $min=$_POST['minute'];
  12. $sec=$_POST['second'];
  13. $modified = $original+($hr*60*60)+($min*60)+$sec;
  14. echo date("d/m/Y H:i:s A",$modified);echo "\n"; 
  15. ?>
this is ma code i am trying to adding two time but the date will change only once . after that i tried but didnot change the date . please help me ... Thanks in advance.
Dec 10 '12 #1
2 1888
Rabbit
12,516 Recognized Expert Moderator MVP
I have no idea what your question is.
Dec 10 '12 #2
Dormilich
8,658 Recognized Expert Moderator Expert
two things:
- Parse Error: unexpected $end
- time() does not accept parameters
Dec 11 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Larry R Harrison Jr | last post by:
I use the Lebans calendar control and love it; the only thing is that it commonly starts out at the year 1899 rather than the current year. Is there a way to specifically tell it to start at the...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
6
by: Scott | last post by:
I have a start date and an end date in my project that is defaulted to the current date at run-time using the following code... Date1.Value = Now() Date2.Value = Now() I then have some code...
2
by: markryde | last post by:
Hello, I am trying to add the current date to a file name in python script like thus: import os import sys import rpm import time import datetime
3
by: Phillip Vong | last post by:
Using VS2005 w/ simple aspx in VB.net I have a simple databound textbox "LastMtgText" in a formview in the Insert template. All I want to do is make the default date of today when someone goes...
4
by: mcca0081 | last post by:
hi - i'm trying to delete one of the duplicate records based on the most current date. here's the code for my access 2000 db. any help would be appreciated!!! - thank you kindly Sub...
1
by: shiznaw | last post by:
Private Function rprtdate() Dim rprtdates As Date Dim 1mnth As Integer 1mnth= Month(Date) + Month(DateSerial(Year(Date), Month(Date) + 1, Day(Date))) Select Case Frame35.Value 'the following...
17
by: ginajohnst | last post by:
Hi All. I'm having a problem adding days to a date. My date is in the string format dd/mm/yyyy eg. 23/08/2007 in my form field. I can't work out how to add 50 days to that date and then...
4
by: nagarwal | last post by:
Hi All, I am having prblm in adding the no. of days passed to the current date, in a class fuction. This is an immediate requirment plz help.. I am using java.util.Date object for the current...
3
by: Tony K | last post by:
Does anyone know why my 2 date fields on my form that are bound to date fields in the Access DB do not save unless I first modify the dates? Example: When I add a new record, the following line of...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.