There are times, like when creating an intraday event type, when you want to have a field that is just a time and not a date. Would this be more appropriate to put in a new module since the date module uses the ISO date standard to store data? Is there an ISO time standard?

Obviously this could be done by simply choosing a random year/month/day and store the time as a date. Then it would simply be a matter of not displaying the year/month/day in the drop down menu to set the time. However, this feels like an awful hack.



KarenS’s picture

Yes there is an ISO time standard and we're already using it, and yes an iso format with no date would be the way to store a time-only record. I have to think about this though since many functions in this module make the assumption that you're creating something that really is a date and you're proposing something that is not, so I'm not sure how many things would need adjustment for this to work.

nisguy’s picture

I'm posting within this issue because it seems related.

I have been trying to get familiar with CCK and the Computed field, and in one of Agileware's examples he uses your module in the following context:

This example uses KarenS' date module to create two date fields field_start_time and field_end_time which record hours and minutes. We then create a new computed field to work out the duration as a decimal number of hours (so 1.5 is 1hour, 30minutes).

The problem that I am having is that your module doesn't seem to allow a field that records only hours and minutes. Am I misunderstanding something here?

I'm trying to put together a timesheet application at my company where users would update their schedule and the totals could be computed.

Any help would be apprecieted.

KarenS’s picture

You are correct that currently the 'year' field is required. This is partly to make validation more manageable, and partly because I have trouble understanding why a 'time' would not also have a 'date', which is why I haven't been in any particular hurry to do anything about this.

In your example, a timesheet, the 'times' do have dates, you just may prefer to display only the 'time' portion of the date, which you can do now. You have an almost unlimited amount of control over the display (open up your 'advanced display options'), so you can set your field up to display only the time, and you don't need to create a date that has no time.

Anyway, if there is a reason to create times without dates, one of the biggest challenges would be to think through a system that can be used to validate results. Currently I make a date out of what is returned and then check if it is a valid date using php date functions. If that can't be used, validation gets much more difficult. If you have a good use case for creating times without dates and you want to try to make a patch to adapt the module not to require a date, I'd be glad to review it, but creating something like this is not very close to the top of my TODO list, and you'd still need to convince me that it is really needed :-)

nisguy’s picture

Thanks for your reply, but I was able to adapt the regular text integer field to do what I needed. I guess what threw me was that example didn't explain very well how to setup the date field.

It makes sense that times should be attached to a year, but in my timesheet example, I intended the 'end of schedule period' date to be chosen at the top of the form and the times to be entered would be assumed to correspond to days of the week (sat-fri) within that period. Clearly, my app is not that sophisticated.

Thanks for the module.

raintonr’s picture

I was looking for a way to record a time (duration) without a date. Ideally would want to highlight Hour/Min/Sec in the 'granularity' box and record just that.

Why? Because on a sporting site, we have a number of 'challenges', and users can report how they've performed on each. How they went is entered as a node - which has a noderef to the original 'challenge', their comments, etc, and of course the time taken to complete.

I know one could use a text field and some sort of PHP validation that is in the form "HH:MM:SS", but it would be nicer to have a proper field here.

Another alternative would be to have an integer field with number of seconds, but again, that is horrible for the user.

If this could be stored in the database as an integer (or decimal for those people who might need this - we don't, but someone might) number of seconds but formatted "HH:MM:SS", or "MMM:SS", or "", or whatever I guess that would cover most scenarios.

If any other options sound easier, or there's another way, would love to hear.

Thanks :)

thomie’s picture

if you (or others) are interested in a module for recording 'durations', you can send me a message. I needed the same thing, and build a cck duration field type recently. You can select years/months/days/hours/minutes/seconds from a granularity box, and the data is stored in ISO format for duration. For example P1Y2M3DT4H5M6.78S would be 1 year, 2 months, 3 days, 4 hours, 5 minutes and 6.78 seconds. But any of these could be left blank, so years is for example not required as in date module. Note that the number of seconds can be a decimal, the other elements are integers. A duration field is optionally stored as seconds as well, which can be used for computations. For displaying: either the above ISO format, the number of seconds, or HH:MM:SS for time durations can be used.

rjleigh’s picture

+1 for time without date feature

"... you'd still need to convince me that it is really needed :-)"

I understand this is not a priority for you, but there are several areas where I would find this extremely useful. I'd like the option to create schedule-like dates; i.e. a date item that refers to 1-3pm each day in a range (as opposed to a start date with 1pm through the end date of 3pm) - I know that that can be accomplished with multiple entries, but that would be a chore in my case.

It could then be further abstracted for scheduling, say wednesdays from 1-3, or second thursdays from 1-3. I can build this separately, but it seems like it should be here.

I'm looking for this in the 5.x version, BTW.

rjleigh’s picture

thinking a little further on these lines:

Now, I understand the desire to use standard strings for php validation, so couldn't a time entry be an ISO date that has just a year and time? (I'm not sure where that config would be valuable otherwise, so it might not even need further type-marking).

The year could essentially be discarded for display, or calculation with Y-M-D only dates. So, I can create two time fields, for instance, showing a 1-2pm slot, and they can be combined with an array of single Y-M-D entries to create a schedule (for a lot of entries, that would be more efficient). It would easily allow skipping days, but not require completely separate node entries for multiple occurrences.

If an end time is later than a start time, a +1 day could be inferred (to cover time ranges past midnight).

I can't imagine that more people wouldn't find this to be a highly valuable addition to an already important mod.

nadavoid’s picture

+1 for time without a date feature.

The reason I would like this feature is, I am creating a list of meeting groups that will meet regularly for several months. The start and end dates are not known, but the meeting time IS known. So I only need to record the meeting times, and it should be a time of day, not just a duration.

Other examples of use cases would be anything that involves a time, but no specific date.
- What time do you usually get up?
- What time are most of your rehearsals?

KarenS’s picture

Status: Active » Postponed

I'm postponing this until the 5.2 version is working. I think that the way I'm using FAPI and the PHP 5 date functions in that version will simplify the code enough to be able to try to add a feature like this in (probably as an additional, optional module instead of as an add-on to the Date module).

rjleigh’s picture

Thanks Karen;

when you do get the time to look at the code, I'd be glad to test things.


KarenS’s picture

Version: 4.7.x-1.0 » 5.x-1.x-dev

New features won't be going into 4.7 any more.

KarenS’s picture

Version: 5.x-1.x-dev » 7.x-1.x-dev

Moving this to HEAD. No new features will be added to the 5.1 version, but it could be considered for the 5.2 version now in HEAD.

rweait’s picture

+1 for time duration.

This duration data type is useful for describing multimedia and events.

Media like video clips, TV shows, films, music, advertisements often see duration as important. Am I looking for a 15 second drum loop, or a Wagerian opera? Can I play a 30 second commercial, or the full minute?

The duration of an event matters, even before it is scheduled for a specific day. Is a training course two hours long or fifteen minutes? Which appointment do I schedule in the remaining time before lunch on Thursday?

Durations are an important parameter of these items and others.

jpetso’s picture

Subscribing, as I'm currently working on a generic "duration" element/field. I don't have high ambitions though to make it integrate with the Date module, it's just going to be a simple widget for displaying a time value (e.g. "3.5") and metric ("days"). Let's see how far I get. No idea if that's what's planned here, or if it should possibly be operating under the Date module family umbrella.

jpetso’s picture

Ok, I added an initial version of my module to, named Duration. Still without CCK features, which means that only developers can make use of the form element at the moment, and nice formatters are not implemented yet. The editing widget might also not fit your needs yet - it's currently a value/metric duo as described in the previous comment, or alternatively a single dropdown with fixed duration options to choose from.

Extending the element to suit your needs should be pretty easy though (for developers), as most of the groundwork is there. In comparison to the former version of this form element (which was only used privately in my Temporary Invitation module), I seem to have got the data structure right this time - reading the comments and use cases here played a good part in this, too :)

The issue for storing generic duration data is that you can't really express it as time deltas (that is, seconds) because once you reach larger units like months and years, those do not necessarily have similar length (31/30/28 days for a month, 365/366 days for a year). If I want to schedule stuff so that it happens exactly in a month, on the same day as today, the time delta approach falls down.

What I'm doing now is to take the mktime() parameters - seconds, minutes, hours, days, months and years - and store them separately, with a set of helper functions to ease the display and management of that data. Plus milliseconds, because exact demands like for video and audio media could make that necessary.

So, like it or not, depends. Anyone who wants to help out is invited to contribute!

Will Kirchheimer’s picture

+ 1 for this feature

Looking to add time to-from to an existing module that only supports Date of occurrence (station playlist)

The module as built is more interested in the current schedule of a station, and then the date of the actual playlist. (less archival than my goals)

Having time only would allow me to interact with my needs for the module without having to interfer with the designers vision.

While still limiting the wear-tear on the Djs, avoiding multiple data entry repetition, and of course limiting chances for user input error.

Will Kirchheimer’s picture

Well, I guess there is this then:

will_in_wi’s picture


I want the ability do month/day but not year, because I have a site that has the birthdays of the teens show up in a block. I do not want their ages also showing up. Right now I use a custom php date format. What would do this for me is to allow me to only prompt the user for a month and day and then use my existing php date format. The date module would just add the current year and then ignore it.

jpetso’s picture

Ok, so the Duration module (actually it's three of them now: API, form elements, CCK field) has been completely reworked and now features a working CCK field, but also a reusable PHP object that can be used for parsing ISO 8601 duration strings. If you want to have a duration field (as opposed to "time on any date" as with the cck_time field above), you might actually like it. If you don't like it, it's probably easy to add the features that you need to like it.

Check out the new release 6.x-0.9 and enjoy! Given that there's now a module for each of the use cases, should we close this issue?

rweait’s picture

Thank You * 1000 !

newbuntu’s picture

I am bit confused!

I was able to do time without date with version 5.x-1.8. I updated to 5.x-2.0-rc, now it broke my app. I get an error message "A valid date cannot be created from".

I wonder if the way I made it work was just an accident! This was how I did it with 5.x-1.8: I just put "h:i A" in "custom input/display format", then checked granularity with "hour, minutes" only.

Can any expert throw in some comments?


alexanderpas’s picture

Status: Postponed » Active

pulling this from postponed - see #10

Chris Przybycien’s picture

I'd like to support this feature request as well. I'm putting together a local music scene site and every gig we list has a separate "doors open" and "show starts" time. Currently one must enter the date of the show for each time and it leads to incorrect gig listings due to user input error. The ideal would be to have a single "show date" field then two time-only "show starts" and "doors open" fields.

jasontanner’s picture

I'm struggling at the moment with how to implement a Time only field that would be usable as search criteria which had an explicit Date & Time element.


Lets say you had a node type "Shop" and that shop had different opening/closing hours on different days of the week. There is not necessarily an explicit Date component here - at least not in the definition of the Shop node.

But ..

If I then wanted to create a view that let people search for Shops of a particular type that are open:

1) Now
2) Or on a particular Day of the Week at a particular time
3) Or at some future date

Then of course Date does come into play as well as time.

I had some ideas but ran in to the problem of there being no Time only field type to play with.

I'm sure others have run into this sort of scenario so was wondering how they might have solved this.

jpetso’s picture

Your use case isn't the classical use case for a time-only field as it only applies to some dates in a given week. In my organizer application, stuff like this would be handled by recurring events. I'm not sure whether the Date module supports recurring dates at all, but if any module is going to do this kind of stuff properly then it will likely be Date.

There's also an Office Hours module which seems to meet your description, although I don't think the requested search facilities are available there either.

cyberskier’s picture

+1 for this feature.

I have a gaming site where users input the normal starting and ending times of their games, which occur each week at the same time. I don't need a long list of repeated dates (which is what is generated by this if the "repeat" option is selected, and I don't have the know-how to change that, although I'm learning). Right now I'm using CCK Time, and I've tried Office Hours, but neither of those seem to account for user timezones, so right now I just have everyone enter times using GMT.

kenorb’s picture

+1 for the office_hours module
and +1 for this feature

TimG1’s picture

another +1 for this feature. I'm trying to make a class schedule in my case. Something like...

M: 12:00pm-1:30pm
W: 3:00pm-4:00pm
F: 12:00pm-1:30pm

Also, found this discussion about the same request.


fenfe1’s picture

Hi, I to am trying to add the ability to only show the time for a datetime field.

At the moment a user is asked for the hours and minutes for an event (via dropdowns).

when saved this shows up as the time but with 1st January 2009 at the begining.

I understand that there is a way to only output the time (I don't care about the date but, I just want to hide it), however I can't find a way of doing this.

I am running the latest version of this module (and CCK) for drupal 6.

The field I am using is of type `Datetime' and the widget type is 'select list'.

I can't find any kind of advanced options anywhere, and I can only choose from; short, medium or long for the display type.

Can anyone tell me if / how this can be done?


cyberskier’s picture

Unless there has been a development of which I am unaware, this module doesn't currently support that. Although, I wasn't aware that it was possible to even input hours and minutes without the date (let alone then display just hours and minutes). Maybe somebody a bit more knowledgeable than me can chime in.

Gerald Mengisen’s picture

+1 for this feature.

We have an annual 4-day event, but not always at the same date. So for the planning, we simply use Day 1, Day 2, etc. and use time only for planning our volunteer slots.

CCK Time did exactly what I needed (, but there is no Drupal 6 version....

EclipseGc’s picture

Again a big +1000000000 for this feature. The features of a date_popup limited to 'H' is really nice when you JUST need the client to select a time frame. Using manual select lists isn't nearly as nice :-D

tpainton’s picture


Since drupal doesn't have any good scheduling/booking modules that suit my needs.. (yes I have looked at all of them (open resort, reservation, booking time slots etc) I am trying to hack my own using rules and views.

Basically, I need a set of nodes that represent time slots, for example, "18:00 - 18:30". References from that node to a user represent a booking. By using views, I can limit a user to only slots (nodes) that do not contain a user reference to someone else. I could use a generic text field, but it would be nice to lay these nodes out onto a day view in the calendar. Thus, creating a schedule.

The only thing stopping me is that I can't use time only. Yes, I know I can create a format that displays only the time but the site is set up in such a way that the end user is the one who creates the time slots and therefore, the inclusion of a date is going make things complicated for them. They will likely feel they have to create time slots for every day, when in fact, they don't.. They are used over and over again each day when a cron runs clears the time slots every night at midnight.

So, yes, a time only field for Drupal 6 would be GREAT!

Gerald Mengisen’s picture

The CCK Time module has a Drupal 6 port at, and that might be sufficient for now if you don't need timezone support.

Ultimately, I also see the future of a time-only field in the date module, taking advantage of all the work that has already been done in this area. I might try to come up with a patch by the end of the year.

paganwinter’s picture


arlinsandbulte’s picture

Personally, I question the validity of adding the feature to the _DATE_ module. I think perhaps a seperate field type of time duration might be more appropriate. (And I think that module might exist already)
This would reduce the complexity of the date module (it is complex enough the way it is!)
The time duration module would be relatively simple (just storing a duration does not introduce any timezone or other conversion complexities)

The date module is designed to specify a specific moment in time, and does so pretty well. Granularity settings start at year and go down.
A time duration module should specify a specific length of time. Granularity settings start at second and go up (for smaller than second times, second becomes fractional).

Then, as a seperate feature, I think time duration could be / should be integrated into the calendar module:
Instead of only specifying start date and end date for events, a start date and time duration could be specified instead.

arlinsandbulte’s picture

Just to clarify, this time duration could be a module packaged with the Date module. It would just provide a cck field type of "Time Duration"

arlinsandbulte’s picture

Note: This issue is related to #127200: Allow user to specify duration (relative) or end time (absolute)
It is not really a DUPLICATE, but I think these two issues could have the same solution by creating a new field type of "Time Duration"

jpetso’s picture

Just a reminder: there is already a field called Duration, and it's linked further above in the comments of this issue. I won't say it's the best maintained field ever (sorry), but it's got all of the code foundations that you need to work for duration stuff. Let me also stress that "duration" and "time without a date" fields are fundamentally different types of fields because they need to specify and store data in very different ways.

bomarmonk’s picture

A time field would definitely be useful. It seems like the date module is already doing everything that's necessary for a time field, but the module simply needs to treat a time field as a special case that does not have a year.... and cck time does not work with content multigroup, which prevents me from using it for an office hours multigroup.

cafuego’s picture

I'm looking for a time without date field for conference scheduling.

I know I can store a complete datetime for both session start and end times, but that leads to a lot of administrative overhead and less flexibility when querying the data.

I plan to have a 'session timeslot' node that has a both start end end times associated, but not dates; these would be stored in the 'conference day' node type.

Finally, a session contains a nodereference to both a date and a timeslot (and a room, but that's beside the point)

Being able to refer to refer to a timeslot via only a nid makes the underlying code less complex, and by not allowing the schedulers to freeform enter date and/or time information on each session, but only select a day/date and timeslot node, I can more easily prevent data entry errors.

I'm having a go of using the Duration module to get a workable solution, but having a Time field (that also supports Token) would make life far easier.

Otherwise I'll probably have to add an integer field and do some mangling of input fields, validation handlers and display to convert 16:45:00 to 25740 and vice versa.

Though the tag on this issue says 7.x, a 6.x version would be better ;-)

emattias’s picture

$i++ on being able to enter start and end time without having to enter year and month.

I only need day of the week(mon-sun) and start and stop time. The Fields contain businesses opening hours.

To prepare for a possible implementation should i have my current date fields be datetime or date?

StevenSokulski’s picture


bomarmonk’s picture

Checkout quicksketch's work on the CCK Time upgrade to Drupal 6. I've tested his module and it works pretty well (with mutigroups, etc.), although there is no official project page for it. Anyone interested in taking it to the next level (who really needs time without a date) might have a look here: It probably needs to get renamed to Time Field, or something like this, to prepare for Drupal 7.

Moya’s picture

+1 no necessity for year granularity

PROJECT: Input of mating seasons of animals. Therefore there is no starting year as with a birthday.
USER INPUT: from month - to month via 2 dropdown lists.
PROBLEM: I need to reuse the inserted dates with
- The search function: If the user inputs "March" "May" and someone searches "April" he will find the node with "March to May"
- Timeline
- Sorting in Views

Maedi’s picture

Also +1 for no year requirement. I have a use case very similar to Moya's.

geerlingguy’s picture

I'm tracking this issue in relation to a problem I'm having trying to allow users to filter views results based on a start/end time (unattached to an actual date):

+1 for not requiring a timestamp with a year... however, I might work with another developer to patch/upgrade the CCK Time module so it will serve our purposes (which might be outside the scope of the Date module (since 'date' seems to imply an actual date, rather than an arbitrary time.

Exploratus’s picture


rjbrown99’s picture

I worked around this. I wanted a date setting with only FROM and TO in hours and didn't care about the year. In the field settings, I did this:

1) Set both default values to relative.

2) Customize default value:
today 8am
today 5pm

3) Granularity:

Now my form has two values, year and hour. But the year is already pre-populated as the current year because of the default value. At that point, I just hid the year with CSS display: none. As far as date is concerned, the year is present so it meets the requirements. As far as the user is concerned, they now see no year on the form.

mattbk’s picture


doublejosh’s picture

I actually had problems with the #50 solution from @rjbrown99, I couldn't seem to get the hours to pass through the strtotime.
It always sets the relative time to now. Tried "today 15:00", "yesterday 15:00" and "yesterday 3pm" as well.

Can't even seem to get it by setting a wide year range and hard coding the date time string to a year.

helmuthj’s picture

Hi everyone,

I am new to drupal and not able to fully understand what has been said with respect to this apparently still open issue. What I understand is:
1.) Many people have things like events happening at some time (opening of doors for a concert, end of mating season, etc.) for which it is not practical to enter a date.
2.) The date module is currently "unaware" of this common situation and complains whenever e.g. a year is not being entered.
3.) It is straightforward to change the way dates (year,month,day,hour, ...) are displayed - this is standard usage of the date module.
4.) It is equally straightforward to change the way dates are entered (e.g. specify "H:i"). This particular example, however, results in an error message and leaves the field value not set and hence not usable.

Now, I see a few suggestions for workarounds, some of which probably only apply to older versions of drupal. Modules that do not seem to work for me (a drupal 7 user) are
1.) cck_time
2.) duration
I guess these require a feature that is now longer present in drupal 7 ("content" module?)

I have seen proposed solutions here and elsewhere using the date module but I was unable to make any of those work. I would greatly appreciate something like a wrap-up on the current status of this issue with, if it exists, a detailed step-by-step solution. I'd be totally happy with a year being set to some default value automatically and the time being entered by the user.



jox’s picture


donpwinston’s picture

Good grief, why in the world would you want to force a content manager to enter the year when all that's needed is the time?

doublejosh’s picture

My use case is "Checkin Time" for hotels and B&Bs. Repeatable availability times or daily business open/close times would be more examples.

Again, I've tried to accomplish by pre-populating it and hiding it, but it didn't quite work:

webankit’s picture


mstrelan’s picture

subscribe +1

jbiechele’s picture

subscribe +1

tko’s picture


Let's get this feature rolling.

MichaelCole’s picture

Bump and subscribe

This is useful for describing when a school class meets:

E.g. MWF 10am

cafuego’s picture

Turns out that HTML5 has a time form field that takes HH:MM style input. It would be good to be able to store that in a way that makes it easy to do time based calculations on. MySQL and PgSQL support this as a field type (sadly sqlite is difficult)

keithm’s picture


brz’s picture


cafuego’s picture

I've started on a sandbox project;

There's a problem with Drupal 6 not understanding the TIME column types in mysql and pgsql. There doesn't appear to be a way of adding these either. So I'm having to store the time as DATETIME by prepending '0000-00-00 ' to the input when it's stored and stripping that off again when the time is retrieved and displayed.

Currently it can store the time, display the time in 24h and am/pm format, as well as in hours, minutes or seconds only. It can grab and display the field (optionally with multiple values) in Views and do basic string-based filtering on it.

There is no advanced views integration with time-specific argument and filter handling and no way of combining say a date+time field to create a full DATETIME for display. I'm trying to adapt what exists in date_api, but patches are of course always welcome :-)

soulston’s picture

I have had to work on a few event sites and often I want to add an event that starts at 10pm on a Friday and finishes at 4am on the Saturday. On a calendar this would be listed as covering 2 days which is not really what I want. Ideally it would be great to have an option of having a single start date and a start and end time field.

Does this exist?

facal’s picture

Subscribe. This feature would be great also for me. I need users to be able to select a hh:mm:ss to specify at which point of a video they uploaded something important happens.

jnettik’s picture

This feature would be great for something I'm working on. I have a bunch of seminars that I'm displaying in a table grouped by date. Problem is if I include time, each seminar has a unique time and therefore doesn't group them on date.

My solution is to create a field for the date, that I can group by and another field for the time. For now I'll probably use the solution mentioned earlier of just hiding the year field with CSS but it would still be nice if there was a cleaner solution.

doublejosh’s picture

Looks like there is a Drupal 7 Partial Date module being worked on.

bjcooper’s picture

Version: 7.x-1.x-dev » 7.x-2.0-rc2
Priority: Normal » Minor

+1 for time-only field

I'd also find an actual time-only field handy. I'm doing stuff like room scheduling where users can search for openings at a specific time across many days. I do a query filter with the start and end times only. In the mean time, I think I might just hide the date field...

iantresman’s picture

Here is how I solved the issue in Drupal 6, see "CCK: How to add and display a time span/duration". It's a bit of a kludge, which just defaults to the date 1 Jan 2000 for the year for all "times", and excludes the date when output.

But I seem to have a problem with using this "time" format in Views exposed filters, so it would make sense to have a date/time option that ignores the date completely.

I had hoped I could just define an integer, and then use a widget that forces entry as 37:20 (ie 37 mins, 20 secs), but stores everything in seconds. Or allow a decimal where 37:20 uses a colon instead of 37.20, but I couldn't figure out how to prevent the decimal part being greater than 59.

donpwinston’s picture

Status: Active » Closed (won't fix)

There is some technical issue or else the developer would have done this long ago. It makes no sense not to do it.

cafuego’s picture

Status: Closed (won't fix) » Active

Setting issue status back to active. Please don't close it based on unfounded assumptions.

donpwinston’s picture

oops. This thing shows up under "Your Issues" meaning me? I was cleaning up all of "Your Issues" (My Issues) and closed it. Sorry.

Les Lim’s picture

If you click on the "Following" button at the top of the issue post, you can remove it from the list of issues you're tracking.

cesareaugusto’s picture

This feature is exactly what I'm looking for. I got a Club node type. Of course it represents clubs. Each club has an opening hour. I would like to be able to have some kind of search option like "what's open now" and "what will be open on a given date/time".

I shall give Office Hours a try now. Anyone got updated tips on which would be the best practice to have opening hours?

chalda’s picture

+1 for this feature. I would really appreciate it.

rasheemo’s picture

Priority: Minor » Normal

+1 for time without year feature

pbfleetwood’s picture

Another use case:

I'm preparing our Beach Conditions page. Two nuisances:

1) The page's administrator will enter the times for high and low tides. There is no reason that he should be bothered to enter years and he will be annoyed.

2) I cannot hide the year and separator on the page, because there's no wrapper around them. The date is output as...

<span class="date-display-single">2012 - 8:34am</span>

johnv’s picture

@cesareaugusto, check out #1606886: Current Status Feature

KarenS’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev
Status: Active » Postponed

Major new functionality will go into the 7.3/8 branch we are just starting on.

Andrew_Mallis’s picture

+1 for time-only option

hh:mm:ss useful for videos.

grguth’s picture

There is an ugly but usable workaround if you just need the times independent of the date. For a time field you can create a char/text field (length of 7 or 8 is fine) and then when you build the form use a validation function which is a regular expression to validate the format. If you use a format of hh:mm am (or pm) you can still use the date conversion functions to do time arithmetic and convert back.

byronveale’s picture

+1 here too - potentially a can of worms situation, using entity_reference, the date value would come from the referred-to node, but want to let content creators simply enter a time, not have to repeatedly (conference agenda, so can have six to a dozen items) enter the same date...

Thanks from me too for a truly awesome module, can't imagine Drupal without it!

Paracetamol’s picture

Hello – this just to chime in – we use the timefield module on several sites to accompany date fields. It works pretty well so far – especially considering the differing use cases of times attached to events (e.g. opening hours).

dernetzjaeger’s picture

Timefield is indeed a great module, but in use with Forms API I can't find any validations like the time-part of date module has.

So a mix of both would be great.

Paracetamol’s picture

… agreed! I guess, I'm also pretty much spoiled by the Views options date has to offer.

Another edgy case is encoding dates together with a custom time, especially when preparing data exports.

bunthorne’s picture

Chiming in for an ISO 8601 Duration format in the Date/Time module. Quoting from Wikipedia at the ISO_8601 page:

Durations are a component of time intervals and define the amount of intervening time in a time interval. They should only be used as part of a time interval as prescribed by the standard. Time intervals are discussed in the next section.
Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W as shown to the right. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required, but the maximum number of digits for each element should be agreed to by the communicating parties. The capital letters P, Y, M, W, D, T, H, M, and S are designators for each of the date and time elements and are not replaced.

I am looking into Timefield, but I don't know that it represents data with ISO 8601 format--which is required to make use of the Text Snippets in search engines. I'm checking on that.

s.Daniel’s picture

Issue summary: View changes
Related issues: +#259308: Allow "fuzzy" granularity