473,654 Members | 3,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting day and month from a date string in PHP

1 New Member
This is my first page

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="post" action="ins_comp.php" onsubmit="return form_chk();">
  2.  
[Please use CODE tags when posting source code. Thanks! --pbmods]

this is next page where i'm printing the posted values

Expand|Select|Wrap|Line Numbers
  1. echo '<pre>';
  2. print_r($_POST);
  3.  
its displaying


Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [sys_id] => Dbms0001
  4.     [domain] => Discnet
  5.     [User] => prashanth
  6.     [emp_code] => Dt0125
  7.     [os] => WINDOWS XP
  8.     [ip_addr] => 192.168.10.31
  9.     [date_ins] => 24-05-2007
  10.     [months] => 4
  11.     [years] => 2007
  12. )
  13.  
the thing i do want to print months and years ... please help anyone....
May 24 '07 #1
1 1673
pbmods
5,821 Recognized Expert Expert
Changed thread title to better match contents.

---------------

Heya, prashanth23in. Welcome to TSDN!

Take a look at the date and strtotime functions. They should do just about exactly what you're looking for.
May 24 '07 #2

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

Similar topics

2
2878
by: deanfamily11 | last post by:
I have a program that gets a date from the user in the format dd/mm/yy, and I need to extract the d's, m's, and y's to be used within the program. I have the program get the date as a string. How can I get the days, month, and year numbers out of it?
4
44353
by: wolftor | last post by:
Month(date) shows the month number. Is there a way to get the month name ie. October? -- Regards, Peter
34
9286
by: prosoft | last post by:
When I use Dim myDTFI As DateTimeFormatInfo = New CultureInfo("he-IL", True).DateTimeFormat Dim strhmon1 As String = (myDTFI.GetMonthName(hmon1)) MsgBox(strhmon1) I get the local name of the gregorian month. How do I get the local name of the local month ? Tia
0
1896
by: larry | last post by:
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data dates only, this code is intended to use more thrifty event descriptions (3rd saturday, last tuesday, etc.) as well as traditional one-of dates. The core here here is quite spartan, no table logic or or db cruft included (I figure you have our own...
4
39323
by: perryclisbee via AccessMonster.com | last post by:
I have dates of service for several people that range all over each month. ie: patient had dates of service of: 7/3/2006, 7/24/2006 and 7/25/2006. I need to create a new field via a query that will convert each of the records of these service dates to the first date of that month, with results showing: 7/1/2006, 7/1/2006, 7/1/2006. How would you place an expression on a query that will convert any given date to the first day of the month...
7
1976
by: whitsey | last post by:
Help! I am trying to write an SQL statement (without much luck) to extract the total number of searches and orders from a particular customer, grouped into days/months/weeks (depending on the report type. The tables are as follows:
4
3841
by: dexter48 | last post by:
Hi I'm searching for a string occurance in a text file. I find the string ok and write the results to a log file. But on the line above is also some information I need. How can i get that. The string occurs a number of times, but not an exact match for the string above. Can you help please: see code #!C:\\Perl\\bin use File::Copy; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); ...
25
2568
by: rekhasc | last post by:
hi...... Its very urgent.............. how can i take only the year and month part and it should save in the database in the month and year field separately......... when i enter the date in the form it should automatically update the year and month field in the db........ in my proj i am drawing a graph on daily, monthly and yearly basis..... i got how to draw a graph on day basis but i dont know how to draw a graph on month and year basis can...
0
2359
by: marlberg | last post by:
Platform: Windows2000, WindowsXP, Windows Vista, etc Language: C#, ASP.NET Pre-compiled Libraries: Enterprise Library 3.0 full I have a requirement to implement in and display in C# and ASP.NET a DataGrid with Updatable rows based on a date retrieved from a data table in SQL Server. Below is the design algorithm. 1. Retrieve the Max(rundate) From MyDataTable 2. If the current month -1 = rundate .month from step 1 then 2a. ...
5
1513
by: Brian S. | last post by:
Hi, I am trying to calculate the number of DayOfWeek in a month.. for instance.. this month April I want to know how many tuesdays there are in this month, this year I try to use where intDOW = FirstDayOfWeek.Tuesday dtmFirst = #4/1/2008#, dtmLast = #4/30/2008# DateDiff(DateInterval.Weekday, dtmFirst, dtmLast, intDOW) now I would think from reading.. that i would end up with 5, but i am ending
0
8375
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.