Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Sleep Cycle Calculator (Bedtime and Wake-Up Time)

Choose a mode and enter the time you want to wake up (or the time you go to bed). Suggested bedtimes (or wake-up times) at the end of a sleep cycle are calculated for 1 to 7 cycles at once.

Enter the hour with AM or PM (for example, 11:30 PM is hour "11 PM" and minutes "30"). The 24-hour clock ("23") works too. If you leave the cycle length and the time to fall asleep blank, 90 minutes and 15 minutes are used. Based on the common idea that 4 to 6 cycles a night is a good amount, the rows for 5 and 6 cycles are marked "recommended".
Result
Enter a time in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter the time you want to wake up, such as 6:00 AM, and get suggested bedtimes that line up with the end of a sleep cycle, for 1 to 7 cycles at once
  • It also works the other way: enter the time you go to bed, such as 11:00 PM, and get suggested wake-up times at the end of a cycle
  • Based on the common idea that 4 to 6 cycles a night is a good amount, the rows for 5 and 6 cycles are marked "recommended"
  • You can change the cycle length and the time it takes you to fall asleep to fit your own experience (defaults: 90-minute cycles, 15 minutes to fall asleep)
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
The 90-minute sleep cycle is an average. The real length is said to vary from about 70 to 120 minutes from person to person, and even from night to night for the same person. The results are only a guide based on a general theory, not medical advice. If sleep problems such as trouble falling asleep or strong daytime sleepiness continue, consider talking to a doctor.

What is this calculation used for?

Choosing a bedtime before an early start (trips, business travel, exam day)

On the night before a 5 AM alarm, it is easy to pick a bedtime by feel. With a 5:00 wake-up and 15 minutes to fall asleep, 6 cycles (9 hours of sleep) point to 19:45 (7:45 PM) the evening before, and 5 cycles (7 hours 30 minutes) point to 21:15 (9:15 PM).
The end of a cycle is said to be a time when sleep is light, so waking up then is thought to be easier. People differ, but working back from the wake-up time helps you build the habit of going to bed on purpose instead of staying up late without noticing.

Planning sleep the night before a test or a big presentation

Should you keep studying or go to bed early? When you are torn, you can work back from your wake-up time to see how much time you have. For a 6:30 AM wake-up, 5 cycles (7 hours 30 minutes of sleep) point to a 22:45 (10:45 PM) bedtime, and 4 cycles (6 hours) point to 0:15 (12:15 AM).
Sleep is said to help the brain sort and store memories, so planning backward from the sleep you need is a safer strategy than cramming all night.

Keeping a sleep routine with shift work or after a night shift

When your start time changes from day to day, you have to think about when to sleep every time. Just enter a different wake-up time and recalculate to get that day's suggested bedtime right away.
The calculation is the same when you sleep during the day after a night shift. However, daytime sleep tends to be lighter because of the circadian rhythm (body clock), so treat the results as a guide only, and if you keep feeling unwell, consider talking to a doctor.

Deciding how long to nap

One idea is that a nap of one full cycle (about 90 minutes) makes it easier to wake up during light sleep. Use "find wake-up time" mode for one cycle to see when to set an alarm (for example, lie down at 13:00 (1:00 PM), take 15 minutes to fall asleep, and wake up around 14:45 (2:45 PM)).
On the other hand, another idea recommends a short nap of about 15 to 20 minutes, before you reach deep sleep. A long nap can make it harder to fall asleep at night, so choose what fits your own life.

Formula

Bedtime (working back from the wake-up time)
Standard notation (the usual math form)
\(B\) \(=\) \(W\) \(-\) \(F\) \(-\) \(n\) \(\times\) \(C\)
In words (symbols replaced with words)
⑤ \(B\): bedtime \(=\) ① \(W\): wake-up time \(-\) ② \(F\): time to fall asleep \(-\) ③ \(n\): number of cycles \(\times\) ④ \(C\): cycle length
The formula in words
① Start from the \(W\): wake-up time
② subtract the \(F\): time to fall asleep
③ then subtract the \(n\): number of cycles
④ multiplied by the \(C\): cycle length
⑤ and you get the \(B\): bedtime
Quick example
For someone who wants to wake up at 6:00 AM, takes 15 minutes to fall asleep and sleeps 5 cycles of 90 minutes, the bedtime is (the time goes back past midnight, so it falls on the previous day)
bedtime (22:15 the day before) \(=\) wake-up time (6:00) \(-\) time to fall asleep (15 min) \(-\) number of cycles (5) \(\times\) cycle length (90 min)
\(15 + 5 \times 90 = 465\)
\(465 \div 60 = 7.75 \rightarrow 7{:}45\)
\(6{:}00 - 7{:}45 = -1{:}45 \rightarrow 24{:}00 - 1{:}45 = 22{:}15\)
Key idea
So 22:15 on the 24-hour clock, or 10:15 PM the night before. If your bedtime is fixed instead, add the same parts in the other direction: wake-up time = bedtime + time to fall asleep \(F\) + number of cycles \(n\) × cycle length \(C\). This calculator works out every case from \(n = 1\) to \(7\) and marks 5 and 6 cycles "recommended", based on the common idea that 4 to 6 cycles a night is a good amount. Keep in mind that the 90-minute cycle length is an average. The real length changes from person to person, and even from night to night. Use the results only as a guide.
Number of cycles and total sleep time
Standard notation (the usual math form)
In words (symbols replaced with words)
\(S\) \(=\) \(n\) \(\times\) \(C\)
③ \(S\): sleep time \(=\) ① \(n\): number of cycles \(\times\) ② \(C\): cycle length
The formula in words
① Take the \(n\): number of cycles
② multiply it by the \(C\): cycle length
③ and you get the \(S\): sleep time
Quick example
The sleep time for 6 cycles of 90 minutes is
sleep time (9 hours) \(=\) number of cycles (6) \(\times\) cycle length (90 min)
\(6 \times 90 = 540\)
\(540 \div 60 = 9\)
Key idea
With 90-minute cycles, 4 cycles are 6 hours, 5 cycles are 7 hours 30 minutes and 6 cycles are 9 hours. The round figure of "7.5 hours of sleep" that you sometimes hear is said to come from this \(90 \times 5\). Sleep time \(S\) is the time you are actually asleep. The time from getting into bed to waking up is this plus the time to fall asleep \(F\).
To find your bedtime, work back from your wake-up time - bedtime = wake-up time − (time to fall asleep + number of cycles × cycle length). The idea is to wake up at the end of a cycle, when sleep tends to be light. Because 90 minutes is only an average and people differ, use the results as a guide.

Symbols and terms

Symbols

\(B\) bee Bedtime - the time you get into bed. This is what the calculator finds in "find bedtime" mode. It is the first letter of "bedtime".
\(W\) double-u Wake-up time. It is an input in "find bedtime" mode and the answer in "find wake-up time" mode. It is the first letter of "wake".
\(F\) ef Time to fall asleep - the time from getting into bed until you actually fall asleep. The default in this calculator is 15 minutes. It is the first letter of "fall asleep".
\(n\) en The number of sleep cycles. This calculator works out and shows every case from \(n = 1\) to \(7\).
\(C\) see The length of one sleep cycle. The average is said to be about 90 minutes, which is also the default in this calculator. It is the first letter of "cycle".
\(S\) ess Sleep time - the length of time from falling asleep to waking up, found with \(S = n \times C\). It is the first letter of "sleep".

Terms

sleep cycle One round of non-REM sleep followed by REM sleep, which repeat in turn while you sleep. The average is said to be about 90 minutes, but it can range from about 70 to 120 minutes depending on the person (and the night). Most people are said to go through about 4 to 6 cycles a night.
non-REM sleep Sleep that rests the brain, with stages from light to deep. It comes first after you fall asleep, and growth hormone is said to be released most actively during deep non-REM sleep.
REM sleep Light sleep in which the body rests but the brain is active, and vivid dreams are common. REM stands for "rapid eye movement", because the eyes move quickly under the eyelids. It comes in the second half of each cycle and tends to get longer toward morning.
circadian rhythm The body's built-in rhythm in which body temperature, hormone release and more change on a cycle of about 24 hours. It is also called the "body clock". Jet lag happens when this rhythm is out of step with the local time.
sleep latency The time it takes to actually fall asleep after you get into bed and try to sleep. It is the "time to fall asleep" in this calculator, and for healthy adults it is said to be about 10 to 20 minutes.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these points is the quickest way forward.

Time and elapsed time (Grades 2–3)
  • Knowing the difference between a time of day (a point in time, such as 6:00) and an amount of time (a length, such as 9 hours)
  • Being able to find the time a number of hours and minutes before or after, and knowing that going back past midnight or forward past midnight moves you to the previous or next day
The 24-hour clock (Grades 3–4)
  • Being able to rewrite AM and PM times as 0 to 23 hours, such as 10 PM = 22:00
Multiplication (Grades 3–4)
  • Being able to multiply a two-digit number by a one-digit number, such as 90 × 5
Converting minutes and hours (Grades 3–4)
  • Using 60 minutes = 1 hour to convert amounts such as 465 minutes = 7 hours 45 minutes

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the bedtime from the wake-up time
Wake-up time 6:00
Time to fall asleep (min) 15
Sleep cycle length (min) 90
Number of cycles 5
Bedtime =MOD(B1-(B2+B3*B4)/1440,1)
Table to find the wake-up time from the bedtime
Bedtime 23:00
Time to fall asleep (min) 15
Sleep cycle length (min) 90
Number of cycles 6
Wake-up time =MOD(B1+(B2+B3*B4)/1440,1)
Table to find the sleep time from the number of cycles
Sleep cycle length (min) 90
Number of cycles 5
Sleep time (min) =B1*B2
Sleep time (hours) =B3/60
Inside Excel, a time of day is stored as a fraction of a day, where 1 day = 1 (a serial number). So to add minutes to a time such as "6:00" or subtract them, divide the minutes by 1440 (= 24 hours × 60 minutes) first. The MOD function brings the result back into the range 0:00 to 24:00 when it crosses midnight. The answer in the first table is 22:15 (10:15 PM the night before), and in the second table it is 8:15 (8:15 AM the next morning). Note that because MOD handles the change of day, the table does not show "previous day" or "next day".
If the result in B5 shows as a number such as "0.927…", change the cell format to "h:mm" (time), or to "h:mm AM/PM" for the 12-hour clock. The answers in the third table are 450 (minutes) and 7.5 (hours). Just replace the numbers in column B with your own.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the bedtime from the wake-up time
Wake-up time 6:00
Time to fall asleep (min) 15
Sleep cycle length (min) 90
Number of cycles 5
Bedtime =MOD(B1-(B2+B3*B4)/1440,1)
Table to find the wake-up time from the bedtime
Bedtime 23:00
Time to fall asleep (min) 15
Sleep cycle length (min) 90
Number of cycles 6
Wake-up time =MOD(B1+(B2+B3*B4)/1440,1)
Table to find the sleep time from the number of cycles
Sleep cycle length (min) 90
Number of cycles 5
Sleep time (min) =B1*B2
Sleep time (hours) =B3/60
The same formulas as in Excel, including the MOD function, work as is. Copy the whole table, paste it into cell A1, and replace the numbers in column B with your own.
If a result shows as a number such as "0.927…", you can change it to a time with "Format → Number → Time" in the menu.

How to calculate it in Python

from datetime import datetime, timedelta

wake_time = datetime(2026, 7, 13, 6, 0)  # wake-up time (the date is a placeholder used to detect a change of day)
fall_asleep_minutes = 15                 # time to fall asleep (minutes)
cycle_minutes = 90                       # sleep cycle length (minutes)

for cycles in range(7, 0, -1):
    bedtime = wake_time - timedelta(minutes=fall_asleep_minutes + cycles * cycle_minutes)
    sleep_hours = cycles * cycle_minutes / 60           # sleep time (hours)
    recommended = "(recommended)" if cycles in (5, 6) else ""  # guide based on the 4-6 cycles a night idea
    day = "previous day " if bedtime.date() < wake_time.date() else ""
    print(f"{cycles} cycle{'s' if cycles > 1 else ''} ({sleep_hours:g} h of sleep): {day}{bedtime:%H:%M} {recommended}")
Runs with the standard library only. timedelta is an object for a length of time; subtract it from the wake-up time and you get the bedtime (Python handles the change of day by the calendar). To find the wake-up time from a bedtime instead, change the subtraction (-) to an addition (+) and set the wake_time line to your bedtime. Also flip the comparison in the day line to ">" and change "previous day" to "next day", so that results after midnight are correctly marked "next day". To print times on the 12-hour clock, use %I:%M %p instead of %H:%M.

How to write it in LaTeX and other math languages (copy and paste)

Bedtime (working back from the wake-up time)
B = W − F − n × C
B = W - F - nC
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>B</mi><mo>=</mo>
    <mi>W</mi><mo>&#x2212;</mo>
    <mi>F</mi><mo>&#x2212;</mo>
    <mi>n</mi><mo>&#x00D7;</mo><mi>C</mi>
  </mrow>
</math>
B = W - F - n C
b = w - f - n*c
B := W - F - n*C;
B = W - F - n*C;
B = W - F - nC
Number of cycles and total sleep time
S = n × C
S = nC
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>S</mi><mo>=</mo>
    <mi>n</mi><mo>&#x00D7;</mo><mi>C</mi>
  </mrow>
</math>
S = n C
s = n*c
S := n*C;
S = n*C;
S = nC

How to have ChatGPT  do the calculation

You are a calculation assistant for sleep cycles. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

A person wants to wake up at 6:00 AM. It takes them 15 minutes to fall asleep, and one sleep cycle is 90 minutes long.
For each number of cycles from 1 to 7, calculate the bedtime with "bedtime = wake-up time − time to fall asleep − number of cycles × cycle length". If the time goes back past midnight, move it to the previous day.

Show a list of the bedtime (on both the 24-hour and 12-hour clock) and the sleep time for each number of cycles. Also add a note that this is a guide based on a general theory, not medical advice.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.