Cron Expression for Daily at 6 PM
Run a cron job once per day at 6:00 PM using 0 18 * * *. Ideal for end-of-day summaries, reports, and cleanup tasks.
Expression
0 18 * * * At 18:00 every day
Use Cases
- • Sending end-of-day summary reports
- • Running post-business-hours database maintenance
- • Triggering daily backup after work hours
- • Generating evening analytics dashboards
Code Examples
Crontab
# At 18:00 every day
0 18 * * * /path/to/your/script.sh GitHub Actions
name: Scheduled Job
on:
schedule:
- cron: '0 18 * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running Daily at 6 PM" systemd Timer
[Unit]
Description=Daily at 6 PM timer
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target node-cron (Node.js)
import cron from 'node-cron'
// At 18:00 every day
cron.schedule('0 18 * * *', () => {
console.log('Running Daily at 6 PM')
}) Spring (@Scheduled, Java)
// At 18:00 every day
@Scheduled(cron = "0 0 18 * * *")
public void run() {
// your task
} Spring cron has 6 fields (a leading seconds field), so a 0 is prepended to the standard 5-field expression.
Tips
- ✓ Cron uses 24-hour time, so 6 PM is hour 18
- ✓ Good for tasks that should run after business hours end
- ✓ Less likely to affect user experience during off-peak hours
- ✓ Consider time zones for distributed teams
Frequently Asked Questions
How do I express 6 PM in cron?
Use 18 in the hour field. Cron uses 24-hour format, so 6 PM is 18. The full expression is 0 18 * * *.
Can I run at 6:30 PM instead?
Yes, use 30 18 * * * to run at 18:30 (6:30 PM) every day.