Loading

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.

Thank you in advance ^_^



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

cidfrey's picture

Thank you for your reply and I appreciate it.

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
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal

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

are those codes work thanks ^^

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...

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--

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

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 also to get the actual number of hrs. used the datediff ().

Wow this is an Old forum !!! .I think u already got the solution ...
I hope this will help to readers and googlers

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"

Download this file for complete demonstration <<-------------------------------<<<<<<<
>>>>>>>>------------------------------------------------------------------------------>>
from Evan Millana >>>>>------On error goto hell ok ok! ------------------>>

=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

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

import java.io.*;
import java.text.*;
import java.util.StringTokenizer;
public class Payroll
{
public static void main(String args[])throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String empCode;
System.out.print("Enter Employee Code: "); //Get employee Code
empCode = br.readLine();
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

Please Help Me Po..
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 .. :)

ced's picture

contact me
09081805286
cedrickblas@yahoo.com

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

...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!!
thank you in advance...

for syntax command....

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:

09993970779
silentrockgrl@yahoo.com

tnx.....

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

please help me to set a payroll system please.. just visit me in facebook
balgarz309@yahoo.com thank you

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?

ced's picture

make use of datediff

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

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • You may insert videos with [video:URL]
  • 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].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
To prevent automated spam submissions leave this field empty.