473,771 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hospital arrival time - find hour from TIME and day of the week from DATE

4 New Member
hi!
HOUR FROM TIME
i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

DAY OF THE WEEK FROM DATE IN VBA
ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

APPEND DATE AND DATE STRING
iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

~thank you soo much for the help!
Mar 29 '07 #1
2 1755
pureenhanoi
175 New Member
hi!
HOUR FROM TIME
i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

DAY OF THE WEEK FROM DATE IN VBA
ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

APPEND DATE AND DATE STRING
iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

~thank you soo much for the help!
+ to get Hour, Minute, Second from time value, you can use these functions:
hh = Hour(yourTimeVa lue) or hh = Hour(TimeValue( "17:00:26") )
mm= Minute(yourTime Value)
ss = Second(yourTime Value).
+ to convert full-timevalue to short time value, you can use Format function
shortTime = Format(timeValu e,"hh:mm")
+ to get day of week, use this function
weekday(Date) will return day in number
weekdayName(wee kday(Date)) will return day name (Sunday,Monday. ..)
if you need short format of day name, you can use an array to store dayname, and use index = Weekday(Date) to determine dayname
dayName = DayNameArray(in dex)
+ to combine dayname with date variable, you can use string concate
fullDayName = Date & " " & dayName
Mar 29 '07 #2
vijaydiwakar
579 Contributor
hi!
HOUR FROM TIME
i) does anyone know how to determine which hour a time value lies in? the arrival time is in hh:mm:ss format. for e.g.: for an arrival time of 17:00:26, the correct conversion should be: 17:00.

DAY OF THE WEEK FROM DATE IN VBA
ii) if a cell's value is a date, in the form: 14/08/2006, how would you detect which day of the week is it? like monday, tuesday, wednesday, etc.

APPEND DATE AND DATE STRING
iii) is it possible to append a date variable , say 27/08/2006, with its corresponding day(which would be a string), say SUN. e.g, combine 27/08/2006 and sun to become 27/08/2006 SUN

~thank you soo much for the help!
use format function like
MsgBox Format(Now, "HH:MM")
format(date,"dd dd dd/mm/yyyy")
try it good luck
Mar 29 '07 #3

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

Similar topics

1
7314
by: ian douglas | last post by:
Hey all. I know with Perl "there's more than one way to do it", but I'd rather not reinvent the wheel... /usr/share/zoneinfo/Etc/ contains files like GMT-5 or GMT+8 etc which would be really handy for me to tweak $ENV{'TZ'} to play with dates and times, but I'm trying to find the 'best' approach to handle this scenario:
2
5219
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
10
2706
by: soup_or_power | last post by:
Hi I have a requirement to compare the user entry for mm/dd/yy/HH/mm (month, day, year, hour, minute) to the Easter Standard Time. I am using the following script, but it is not giving the right answer. Your kind help is appreciated. Thank you! //this is what user enters var gdate = new Date(f.year.value, f.month.value, f.day.value, f.hour.value, f.min.value);
14
2499
by: George | last post by:
In Time.h there is a structure defined for time settings. I'm building an embedded system that has a Real Time Clock but it's not PC compatible. My question is: I don't some elements of the structure such as day of the week or day of the year, but I do know year,month,date,hour,min,sec. Does the language support filling in the missing elements. And is there a consistency check for that time structure.
4
2686
by: richardkreidl | last post by:
How would I check to see if the current time(military format) is greater then 07:30AM and the day of the week is Monday-Friday. Pseudo code: If Current_Time > 07:30AM and Current_Day = Monday or Current_Day = Tuesday _ or Current_Day = Wednesday or Current_Day = Thursday or Current_Day = Friday then
6
4309
by: D | last post by:
Hello all...I have an issue with one of my java script functions that I'm hoping someone can easily help with. I have a web based application that we use to create/sign up for overtime. When we have holidays we require our employees to sign up in 4 hr increments for the times we post. I'm having trouble creating a time slot that ends @ 12am. 12pm and all other hours work fine for start/end times. however 12am causes problems. My actual...
1
14600
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time = '2007-03-13T15:00:00Z' I want to convert it to my local time. start_time = time.mktime(time.strptime(start_time, '%Y-%m-%dT%H:%M:
5
2839
by: cssExp | last post by:
the problem is, i have a dynamic database driven site, each data is entered with year, week etc.. 2 months ago assuming I'll create sort option in future i put everything, i.e year, week, hour, minute etc.. but forgot month. Now i'm adding sort option but i need month but not available during database entry i use the following. $year = date('Y'); $week = date('W'); $day = date('d'); $hour = date('H'); $minute = date('i');.
0
16509
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all. They are simple, easy, and brief and you should use them any time you need to incorporate any date literals or date math in your T-SQL code. create function DateOnly(@DateTime DateTime) -- Returns @DateTime...
0
9454
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
10103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
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
7460
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.