Guest User

Guest User

  • Tech Writer
  • 529
  • 41.9k

How To Find 744 Monthly hours

Jan 17 2023 8:49 AM
private void PageOverview_Load(object sender, EventArgs e)
{
    lbltoday.Text = (decimal.Parse(DateTime.Now.ToString("HH")) - 1).ToString();
    lblWeek.Text = (int.Parse(lbltoday.Text) + ((int)DateTime.Now.Date.DayOfWeek *24)).ToString();
    lblMonth.Text =  (int.Parse(lblWeek.Text) + ((int)DateTime.Now.Month)-1 *24).ToString();
    lblremaining.Text = (int.Parse(lblMonth.Text) + ((int)DateTime.Now.Year)-1).ToString();
    timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
    lbltoday.Text = (decimal.Parse(DateTime.Now.ToString("HH"))-1 / 24 * 24).ToString();
    lblWeek.Text = (int.Parse(lbltoday.Text) + ((int)DateTime.Now.Date.DayOfWeek *24)).ToString();
    lblMonth.Text = (int.Parse(lblWeek.Text) + ((int)DateTime.Now.Month)-1*24).ToString();
    lblremaining.Text = (int.Parse(lblMonth.Text) + ((int)DateTime.Now.Year)-1).ToString();
}
private void lblMonth_TextChanged(object sender, EventArgs e)
{
    proMonth.Value = (int)decimal.Parse(lblMonth.Text);
}

Send Me Right code For Current hours 


Answers (2)