# Time In & Time Out (For Payroll System)

Submitted by:

I have this Time In and Time Out

Text1.text = Time in
Text2.text = Time out
Text3.text = Total number of hours work

My problem is how can I calculate the total time of work of an employee?

Example:
I put a 8:38 am in Time In then 5:00 pm in Time Out. I want to gather a code which can actually calculate the total number of hours work of an employee.

Because if I add this two numbers it will appear 13:38 instead of 7:22 total number of hours.

If any one know or have an idea please kindly post it.

### you can try to use this

you can try to use this one

where
dtpicker1 is you subtrahend and dtpicker2 is your minuend

Private Sub Command1_Click()
Me.Text1.Text = TimeDiff(Me.DTPicker1.Value, Me.DTPicker2.Value)
End Sub

Private Function TimeDiff(Time1 As String, Time2 As String) As String
Dim MinsDiff As String
Dim TheHours As String
MinsDiff = DateDiff("n", Time1, Time2)
'If midnight is between times
MinsDiff = IIf(MinsDiff < 0, MinsDiff + 1440, MinsDiff)
TheHours = Format(Int(MinsDiff / 60), "0")
MinsDiff = Format(MinsDiff Mod 60, "0")
TimeDiff = TheHours & ":" & MinsDiff
End Function

### Thank You

Sir all I want is a Text1 and Text2 to be converted in the number of hours work. As simple as that.

Is there any way I can calculate it?

Web / System Developer
Contacts :
09327081978
ICCT Colleges Cainta Rizal

### SIMPLEST WAY TO CALCULATE THE NO. OF HOURS

Try this simplest way in this case

In 8:33AM then Out is 5:00PM

1. Use the Military time
In 8:33 - Out 17:00
2. Out +.60 minutes - In - 1hour= ?
ex.
17.00 +.60=17.60-8.33=9.27 - 1hr= 8:27
(Out) (In) (Total)

then, its up to u if u will subtract the breaktime dun sa total

### hi...

are those codes work thanks ^^

### convert the time in sec/min/hour

please do try to analyze more what you want to do... you can't get a no. of hours of work with out deducting the time out with the time in...

### PROGRAM

we also have the same problem i think..
i do also want to have the codes where a professor can see his or her personal account wherein there are his schedule of his class. and eventually make it TIME IN. After wards make it also TIME OUT. Where he can see in another label or text box how many hour/s did he spent teaching in whole day. please response if whoever knows the simple code using FORM only. NOT modules or anything. thanks

--aissa--

### TIME in TIME out

you can use the datediff or dateadd funtion of vb6
to calculate time. ^_^ aja.... hehehe

### How to save time in and time

How to save time in and time out to database

### Evan Millana

Hi Try This Link Sir! http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=69890&lngWId=1
and download the source code, this code is exactly what you want !!

Evan Millana

thank you kuya

### u have to include the date

u have to include the date also to get the actual number of hrs. used the datediff ().

### Wow this is an Old forum !!!

Wow this is an Old forum !!! .I think u already got the solution ...

Create 2 Textboxes and one button

Private Sub Command1_Click()
MsgBox DateTime.DateDiff("n", Text1.Text, Text2.Text)
End Sub
'then divide it by 60 use this "\" not "/" ,to calculate hours and mod 60 to caculate minutes
'Ur var as string = Ur var as integer \ 60 & " Huors And " & varblah Mod 60 & " Minutes"

>>>>>>>>------------------------------------------------------------------------------>>
from Evan Millana >>>>>------On error goto hell ok ok! ------------------>>

### TRY THIS

=E11-B11+IF(B11>E11,1)-AA11

b11= time in
e11 = time out
aA11 = 1HOUR BREAK IF HAVE ONLY

can have your code im trying to debug this same problem., but theres to much trash code on it

### hepl me

how to cr8 a time in time out system ?
what is the code?

### unknown^_^

import java.io.*;
import java.text.*;
import java.util.StringTokenizer;
public class Payroll
{
public static void main(String args[])throws IOException
{
String empCode;
System.out.print("Enter Employee Code: "); //Get employee Code
displayInformation(empCode); //Call the methode display Information
setLogged(empCode);
}
public static void displayInformation(String ecode)throws IOException
{
DecimalFormat df=new DecimalFormat("0.00");
FileInputStream fs = new FileInputStream("employee.txt");
BufferedInputStream bf = new BufferedInputStream(fs);
DataInputStream dis = new DataInputStream(bf);
String line; //Get the data per line
String tempEmployee="";
int noofrecords=5;
String[] code = new String[noofrecords]; //Array of records
String[] employee = new String[noofrecords];
String[] level = new String[noofrecords];
int x=0,find=0;
double salary;
StringTokenizer st1; //Get the data in the text file
while(x

### Time in and time out ..

I need a system where in he dont need to input he's time of in .. he just need a command button and the time will just apper on textbox same with the time out .. supposedly he click again the time in, a msgbox will appear that "YOU ALREADY LOGGED IN" .. same with the time out .. i need it please for my project .. i need also the hours late , day absent and ot .. help me .. :'(
thank you po .. :)

### codes using C#

can you post codes using C# for payroll system...

### sweet18

...may i get the command for the calculation of time in and timeout in fox pro because i don't know how to get the exact command for this program..please reply!!

for syntax command....

### c++ code

can you help me poe to have a C++ code in regarding with the time in and time out payroll system???

just contact me here:

tnx.....

### JAVA

can somebody help me with a simple payroll using java ..

### mga sir me ask po ako. .

mga sir me ask po ako. .
meron po kasi ako dalawang textbox
textbox1 = timein
textbox2 = timeout

pag click ko po sa command button macocompute yung night shift differential kung ilang oras
example po 6am to 6pm pero 10pm pa mgsstart yung night shift so magiging output po yung 10 to 6 lang pano po ang condition dito at yung code?

### make use of datediff

make use of datediff

### sir pls help me i need the

sir pls help me i need the full code of this program i hope you can give me the codes and the format of it thankyou sir

### HUMAN RESOURCE AND MANAGEMENT SYSTEM

please help me, we need to finish this project before January 28, i only focus on time keeping/ time in /timeout/ history log. email me if you can help if not , still wanna say thanks.

### vb6

Text3.Text = Format(DateDiff("n", Text1.Text, Text2.Text) / 60, "0#.00")

### hello po! patulong lng po

hello po! patulong lng po sana kung panu e calculate ang total number of hours in 1 week
****
MORNING
timein= 8:00
timeout=12:00
AFTERNOON
timein=1:00
timeout=5:00

### java

hello po magpapatulong lang po ako sana kung pano eh calculate ang total no. of worked in one week at kung pano po makuha ang hourly rate.....kung pwede po...?

### java

hello po magpapatulong lang po ako sana kung pano eh calculate ang total no. of worked in one week at kung pano po makuha ang hourly rate.....kung pwede po...?

## Pages

• You can enable syntax highlighting of source code with the following tags: `<code>`, `<blockcode>`, `<asp>`, `<c>`, `<cpp>`, `<csharp>`, `<css>`, `<html4strict>`, `<java>`, `<javascript>`, `<mysql>`, `<php>`, `<python>`, `<sql>`, `<vb>`, `<vbnet>`. The supported tag styles are: `<foo>`, `[foo]`.